diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-02 21:55:25 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-03 13:55:58 +0200 |
| commit | 23d108c8e099798dc4d35ce9cbcd3e37fb50f3b2 (patch) | |
| tree | aa068b11b9ac0a4795fb6e86bb8283b1d4718e95 /tests/typ | |
| parent | beca01c826ee51c9ee6d5eadd7e5ef10f7fb9f58 (diff) | |
Font fallback
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/layout/columns.typ | 2 | ||||
| -rw-r--r-- | tests/typ/style/closure.typ | 4 | ||||
| -rw-r--r-- | tests/typ/text/bidi.typ | 14 | ||||
| -rw-r--r-- | tests/typ/text/emoji.typ | 18 | ||||
| -rw-r--r-- | tests/typ/text/fallback.typ | 20 | ||||
| -rw-r--r-- | tests/typ/text/font.typ | 16 | ||||
| -rw-r--r-- | tests/typ/text/indent.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/knuth.typ | 4 | ||||
| -rw-r--r-- | tests/typ/text/microtype.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/shaping.typ | 45 | ||||
| -rw-r--r-- | tests/typ/text/whitespace.typ | 4 | ||||
| -rw-r--r-- | tests/typ/utility/string.typ | 1 |
12 files changed, 57 insertions, 75 deletions
diff --git a/tests/typ/layout/columns.typ b/tests/typ/layout/columns.typ index 7868ac39..0a585868 100644 --- a/tests/typ/layout/columns.typ +++ b/tests/typ/layout/columns.typ @@ -4,7 +4,7 @@ // Test normal operation and RTL directions. #set page(height: 3.25cm, width: 7.05cm, columns: 2) #set columns(gutter: 30pt) -#set text("Noto Sans Arabic", serif) +#set text("Noto Sans Arabic", "IBM Plex Serif") #set par(lang: "ar") #rect(fill: conifer, height: 8pt, width: 6pt) وتحفيز diff --git a/tests/typ/style/closure.typ b/tests/typ/style/closure.typ index 2c9edd81..22626472 100644 --- a/tests/typ/style/closure.typ +++ b/tests/typ/style/closure.typ @@ -23,7 +23,7 @@ )[Level 3] --- -// Error: 22-26 expected font family or auto or function, found length +// Error: 22-26 expected string or auto or function, found length #set heading(family: 10pt) = Heading @@ -33,7 +33,7 @@ = Heading --- -// Error: 22-34 expected font family or auto, found boolean +// Error: 22-34 expected string or auto, found boolean #set heading(family: lvl => false) = Heading diff --git a/tests/typ/text/bidi.typ b/tests/typ/text/bidi.typ index 09e23558..5c666381 100644 --- a/tests/typ/text/bidi.typ +++ b/tests/typ/text/bidi.typ @@ -3,7 +3,7 @@ --- // Test reordering with different top-level paragraph directions. #let content = [Text טֶקסט] -#set text(serif, "Noto Serif Hebrew") +#set text("IBM Plex Serif") #par(lang: "he", content) #par(lang: "de", content) @@ -11,7 +11,7 @@ // Test that consecutive, embedded LTR runs stay LTR. // Here, we have two runs: "A" and italic "B". #let content = [أنت A#emph[B]مطرC] -#set text(serif, "Noto Sans Arabic") +#set text("IBM Plex Serif", "Noto Sans Arabic") #par(lang: "ar", content) #par(lang: "de", content) @@ -19,32 +19,32 @@ // Test that consecutive, embedded RTL runs stay RTL. // Here, we have three runs: "גֶ", bold "שֶׁ", and "ם". #let content = [Aגֶ#strong[שֶׁ]םB] -#set text(serif, "Noto Serif Hebrew") +#set text("IBM Plex Serif", "Noto Serif Hebrew") #par(lang: "he", content) #par(lang: "de", content) --- // Test embedding up to level 4 with isolates. -#set text(serif, "Noto Serif Hebrew", "Twitter Color Emoji") +#set text("IBM Plex Serif") #set par(dir: rtl) א\u{2066}A\u{2067}Bב\u{2069}? --- // Test hard line break (leads to two paragraphs in unicode-bidi). -#set text("Noto Sans Arabic", serif) +#set text("Noto Sans Arabic", "IBM Plex Serif") #set par(lang: "ar") Life المطر هو الحياة \ الحياة تمطر is rain. --- // Test spacing. -#set text(serif, "Noto Serif Hebrew") +#set text("IBM Plex Serif") L #h(1cm) ריווחR \ Lריווח #h(1cm) R --- // Test inline object. -#set text("Noto Serif Hebrew", serif) +#set text("IBM Plex Serif") #set par(lang: "he") קרנפיםRh#image("../../res/rhino.png", height: 11pt)inoחיים diff --git a/tests/typ/text/emoji.typ b/tests/typ/text/emoji.typ new file mode 100644 index 00000000..f8e0d5b6 --- /dev/null +++ b/tests/typ/text/emoji.typ @@ -0,0 +1,18 @@ +// Test emoji shaping. + +--- +// This should form a three-member family. +👩👩👦 + +// This should form a pride flag. +🏳️🌈 + +// Skin tone modifier should be applied. +👍🏿 + +// This should be a 1 in a box. +1️⃣ + +--- +// These two shouldn't be affected by a zero-width joiner. +🏞🌋 diff --git a/tests/typ/text/fallback.typ b/tests/typ/text/fallback.typ new file mode 100644 index 00000000..1db85945 --- /dev/null +++ b/tests/typ/text/fallback.typ @@ -0,0 +1,20 @@ +// Test font fallback. + +--- +// Font fallback for emoji. +A😀B + +// Font fallback for entire text. +دع النص يمطر عليك + +// Font fallback in right-to-left text. +ب🐈😀سم + +// Multi-layer font fallback. +Aب😀🏞سمB + +// Font fallback with composed emojis and multiple fonts. +01️⃣2 + +// Tofus are rendered with the first font. +A🐈ዲሞB diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ index 71ac8d3d..18469b7a 100644 --- a/tests/typ/text/font.typ +++ b/tests/typ/text/font.typ @@ -19,7 +19,7 @@ #text(stretch: 50%)[Condensed] // Set family. -#text(family: serif)[Serif] +#text(family: "IBM Plex Serif")[Serif] // Emoji. Emoji: 🐪, 🌋, 🏞 @@ -39,20 +39,12 @@ Emoji: 🐪, 🌋, 🏞 2π = 𝛼 + 𝛽. ✅ --- -// Test class definitions. -#set text(sans-serif: "PT Sans") -#text(family: sans-serif)[Sans-serif.] \ -#text(monospace)[Monospace.] \ -#text(monospace, monospace: ("Nope", "Latin Modern Math"))[Math.] - ---- // Test top and bottom edge. - #set page(width: 150pt) #set text(size: 8pt) #let try(top, bottom) = rect(fill: conifer)[ - #set text(monospace, top-edge: top, bottom-edge: bottom) + #set text("IBM Plex Mono", top-edge: top, bottom-edge: bottom) From #top to #bottom ] @@ -80,10 +72,6 @@ Emoji: 🐪, 🌋, 🏞 #set text(top-edge: "") --- -// Error: 18-19 expected string or array of strings, found integer -#set text(serif: 0) - ---- // Error: 23-27 unexpected argument #set text(size: 10pt, 12pt) diff --git a/tests/typ/text/indent.typ b/tests/typ/text/indent.typ index 97eae190..6da562f6 100644 --- a/tests/typ/text/indent.typ +++ b/tests/typ/text/indent.typ @@ -19,7 +19,7 @@ starts a paragraph without indent. Except if you have another paragraph in them. -#set text(8pt, "Noto Sans Arabic") +#set text(8pt, "Noto Sans Arabic", "IBM Plex Sans") #set par(lang: "ar", leading: 8pt) = Arabic diff --git a/tests/typ/text/knuth.typ b/tests/typ/text/knuth.typ index 63b7c50d..d5af87f8 100644 --- a/tests/typ/text/knuth.typ +++ b/tests/typ/text/knuth.typ @@ -1,6 +1,6 @@ #set page(width: auto, height: auto) -#set par(lang: "en", leading: 3pt, justify: true) -#set text(family: "CMU Serif") +#set par(lang: "en", leading: 4pt, justify: true) +#set text(family: "Latin Modern Roman") #let story = [ In olden times when wishing still helped one, there lived a king whose diff --git a/tests/typ/text/microtype.typ b/tests/typ/text/microtype.typ index add5e501..dbcb4998 100644 --- a/tests/typ/text/microtype.typ +++ b/tests/typ/text/microtype.typ @@ -24,7 +24,7 @@ A#box["]B --- #set par(lang: "ar") -#set text("Noto Sans Arabic") +#set text("Noto Sans Arabic", "IBM Plex Sans") "المطر هو الحياة" \ المطر هو الحياة diff --git a/tests/typ/text/shaping.typ b/tests/typ/text/shaping.typ deleted file mode 100644 index bb8f4ce9..00000000 --- a/tests/typ/text/shaping.typ +++ /dev/null @@ -1,45 +0,0 @@ -// Test complex text shaping. - ---- -// Test ligatures. - -// This should create an "fi" ligature. -Le fira - -// This should just shape nicely. -#set text("Noto Sans Arabic") -دع النص يمطر عليك - -// This should form a three-member family. -#set text("Twitter Color Emoji") -👩👩👦 🤚🏿 - -// These two shouldn't be affected by a zero-width joiner. -🏞🌋 - ---- -// Test font fallback. - -#set text(sans-serif, "Noto Sans Arabic", "Twitter Color Emoji") - -// Font fallback for emoji. -A😀B - -// Font fallback for entire text. -دع النص يمطر عليك - -// Font fallback in right-to-left text. -ب🐈😀سم - -// Multi-layer font fallback. -Aب😀🏞سمB - -// Tofus are rendered with the first font. -A🐈中文B - ---- -// Test reshaping. - -#set text("Noto Serif Hebrew") -#set par(lang: "he") -ס \ טֶ diff --git a/tests/typ/text/whitespace.typ b/tests/typ/text/whitespace.typ index 831a5543..8dcc59e3 100644 --- a/tests/typ/text/whitespace.typ +++ b/tests/typ/text/whitespace.typ @@ -19,11 +19,11 @@ A /**/B/**/ C --- // Test that a run consisting only of whitespace isn't trimmed. -A[#set text(serif); ]B +A[#set text("IBM Plex Serif"); ]B --- // Test font change after space. -Left [#set text(serif);Right]. +Left [#set text("IBM Plex Serif");Right]. --- // Test that linebreak consumed surrounding spaces. diff --git a/tests/typ/utility/string.typ b/tests/typ/utility/string.typ index 9b57e833..e002b207 100644 --- a/tests/typ/utility/string.typ +++ b/tests/typ/utility/string.typ @@ -38,6 +38,7 @@ --- // Test integrated lower, upper and symbols. // Ref: true + #upper("Abc 8") #upper[def] |
