summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-10-05 19:19:55 +0200
committerLaurenz <laurmaedje@gmail.com>2021-10-05 19:19:55 +0200
commit4ff1519bead4115e4b73d490f6923ebb589b62c1 (patch)
treed6e5699ef64ad74234b58de227e151ee26f0d9a7
parentdcdcf53831aa477b575c9e6ab37eb64f14317c74 (diff)
Fill shorthand for font function
-rw-r--r--src/library/text.rs2
-rw-r--r--tests/typ/text/font.typ2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/library/text.rs b/src/library/text.rs
index 0deda6e4..2816ea81 100644
--- a/src/library/text.rs
+++ b/src/library/text.rs
@@ -39,9 +39,9 @@ pub fn font(ctx: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
let style = args.named("style")?;
let weight = args.named("weight")?;
let stretch = args.named("stretch")?;
+ let fill = args.named("fill")?.or_else(|| args.eat());
let top_edge = args.named("top-edge")?;
let bottom_edge = args.named("bottom-edge")?;
- let fill = args.named("fill")?;
let serif = args.named("serif")?;
let sans_serif = args.named("sans-serif")?;
let monospace = args.named("monospace")?;
diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ
index 9b60d51c..3c8fcaf1 100644
--- a/tests/typ/text/font.typ
+++ b/tests/typ/text/font.typ
@@ -30,7 +30,7 @@ Emoji: 🐪, 🌋, 🏞
// Colors.
[
#font(fill: eastern)
- This is #font(fill: rgb("FA644B"))[way more] colorful.
+ This is #font(rgb("FA644B"))[way more] colorful.
]
// Disable font fallback beyond the user-specified list.