From 17ea0d4ba91aa7dc00b2c0ff61721913a6f1d0b4 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 26 Aug 2021 21:16:29 +0200 Subject: Make font fallback disableable --- tests/ref/text/font.png | Bin 21435 -> 22712 bytes tests/typ/text/font.typ | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/ref/text/font.png b/tests/ref/text/font.png index 44183b3a..b8e0775a 100644 Binary files a/tests/ref/text/font.png and b/tests/ref/text/font.png differ diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ index fbb999f8..ecc07886 100644 --- a/tests/typ/text/font.typ +++ b/tests/typ/text/font.typ @@ -33,6 +33,18 @@ Emoji: 🐪, 🌋, 🏞 This is [#font(fill: rgb("FA644B")) way more] colorful. ] +// Disable font fallback beyond the user-specified list. +// Without disabling, Latin Modern Math would come to the rescue. +#font("PT Sans", "Twitter Color Emoji", fallback: false) +2π = 𝛼 + 𝛽. ✅ + +--- +// Test class definitions. +#font(sans-serif: "PT Sans") +[#font(family: sans-serif) Sans-serif.] \ +[#font(monospace) Monospace.] \ +[#font(monospace, monospace: ("Nope", "Latin Modern Math")) Math.] + --- // Test top and bottom edge. @@ -47,13 +59,6 @@ Emoji: 🐪, 🌋, 🏞 #try(cap-height, baseline) #try(x-height, baseline) ---- -// Test class definitions. -#font(sans-serif: "PT Sans") -[#font(family: sans-serif) Sans-serif.] \ -[#font(monospace) Monospace.] \ -[#font(monospace, monospace: ("Nope", "Latin Modern Math")) Math.] - --- // Error: 7-12 unexpected argument #font(false) -- cgit v1.2.3