diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-30 14:30:44 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-30 14:31:50 +0200 |
| commit | 12a604fec85c6feec7d4c7a6acde8b220c2c1d80 (patch) | |
| tree | 02e21682a4b99e6ba9f3a379214e3eca11cba970 /tests | |
| parent | 79948c0c5e7e8df49a0f2f47ca44c7b6643fbb63 (diff) | |
BiDi tests ✅
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/text/bidi.png | bin | 0 -> 14920 bytes | |||
| -rw-r--r-- | tests/ref/text/shaping.png | bin | 12247 -> 12536 bytes | |||
| -rw-r--r-- | tests/typ/text/bidi.typ | 49 | ||||
| -rw-r--r-- | tests/typ/text/shaping.typ | 4 |
4 files changed, 51 insertions, 2 deletions
diff --git a/tests/ref/text/bidi.png b/tests/ref/text/bidi.png Binary files differnew file mode 100644 index 00000000..c3ad156b --- /dev/null +++ b/tests/ref/text/bidi.png diff --git a/tests/ref/text/shaping.png b/tests/ref/text/shaping.png Binary files differindex 88e7b0ad..e6da3e4d 100644 --- a/tests/ref/text/shaping.png +++ b/tests/ref/text/shaping.png diff --git a/tests/typ/text/bidi.typ b/tests/typ/text/bidi.typ new file mode 100644 index 00000000..44f0cc15 --- /dev/null +++ b/tests/typ/text/bidi.typ @@ -0,0 +1,49 @@ +// Test bidirectional text. + +--- +// Test reordering with different top-level paragraph directions. +#let text = [Text טֶקסט] +#font("EB Garamond", "Noto Serif Hebrew") +#lang("de") {text} +#lang("he") {text} + +--- +// Test that consecutiv, embedded LTR runs stay LTR. +// Here, we have two runs: "A" and italic "B". +#let text = [أنت A_B_مطرC] +#font("EB Garamond", "Noto Sans Arabic") +#lang("de") {text} +#lang("ar") {text} + +--- +// Test that consecutive, embedded RTL runs stay RTL. +// Here, we have three runs: "גֶ", bold "שֶׁ", and "ם". +#let text = [Aגֶ*שֶׁ*םB] +#font("EB Garamond", "Noto Serif Hebrew") +#lang("de") {text} +#lang("he") {text} + +--- +// Test embedding up to level 4 with isolates. +#font("EB Garamond", "Noto Serif Hebrew", "Twitter Color Emoji") +#lang(dir: rtl) +א\u{2066}A\u{2067}Bב\u{2069}? + +--- +// Test hard line break (leads to two paragraphs in unicode-bidi). +#font("Noto Sans Arabic", "EB Garamond") +#lang("ar") +Life المطر هو الحياة \ +الحياة تمطر is rain. + +--- +// Test spacing. +#font("EB Garamond", "Noto Serif Hebrew") +L #h(1cm) ריווחR \ +Lריווח #h(1cm) R + +--- +// Test inline object. +#font("Noto Serif Hebrew", "EB Garamond") +#lang("he") +קרנפיםRh#image("res/rhino.png", height: 11pt)inoחיים diff --git a/tests/typ/text/shaping.typ b/tests/typ/text/shaping.typ index 567a208d..5a469a45 100644 --- a/tests/typ/text/shaping.typ +++ b/tests/typ/text/shaping.typ @@ -8,7 +8,7 @@ Le fira // This should just shape nicely. #font("Noto Sans Arabic") -منش إلا بسم الله +دع النص يمطر عليك // This should form a three-member family. #font("Twitter Color Emoji") @@ -26,7 +26,7 @@ Le fira A😀B // Font fallback for entire text. -منش إلا بسم الله +دع النص يمطر عليك // Font fallback in right-to-left text. ب🐈😀سم |
