summaryrefslogtreecommitdiff
path: root/src/library/font.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-09-27 14:26:50 +0200
committerLaurenz <laurmaedje@gmail.com>2020-09-27 14:26:50 +0200
commitdcf1d09d390af4a7a386e253a3a87791d3243bc2 (patch)
tree7e9f194fa2bd75fdc0fcc4df95df46c8fab8e308 /src/library/font.rs
parent71448c57ffb7f19743c1b33fa7cabd8386cbf68c (diff)
Fix for updated fontdock ✔
Diffstat (limited to 'src/library/font.rs')
-rw-r--r--src/library/font.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library/font.rs b/src/library/font.rs
index e3caeded..ed9360e0 100644
--- a/src/library/font.rs
+++ b/src/library/font.rs
@@ -1,4 +1,4 @@
-use fontdock::{FontStyle, FontWeight, FontWidth};
+use fontdock::{FontStretch, FontStyle, FontWeight};
use super::*;
use crate::length::ScaleLength;
@@ -12,7 +12,7 @@ use crate::length::ScaleLength;
/// # Keyword arguments
/// - `style`: `normal`, `italic` or `oblique`.
/// - `weight`: `100` - `900` or a name like `thin`.
-/// - `width`: `1` - `9` or a name like `condensed`.
+/// - `width`: `normal`, `condensed`, `expanded`, ...
/// - Any other keyword argument whose value is a table of strings is a class
/// fallback definition like:
/// ```typst
@@ -41,7 +41,7 @@ pub async fn font(_: Span, mut args: TableValue, ctx: LayoutContext<'_>) -> Pass
.collect();
if !list.is_empty() {
- *text.fallback.list_mut() = list;
+ text.fallback.list = list;
updated_fallback = true;
}
@@ -53,8 +53,8 @@ pub async fn font(_: Span, mut args: TableValue, ctx: LayoutContext<'_>) -> Pass
text.variant.weight = weight;
}
- if let Some(width) = args.take_key::<FontWidth>("width", &mut f) {
- text.variant.width = width;
+ if let Some(stretch) = args.take_key::<FontStretch>("stretch", &mut f) {
+ text.variant.stretch = stretch;
}
for (class, mut table) in args.take_all_str::<TableValue>() {
@@ -63,7 +63,7 @@ pub async fn font(_: Span, mut args: TableValue, ctx: LayoutContext<'_>) -> Pass
.map(|s| s.to_lowercase())
.collect();
- text.fallback.set_class_list(class, fallback);
+ text.fallback.update_class_list(class, fallback);
updated_fallback = true;
}