BiDi tests ✅
This commit is contained in:
parent
79948c0c5e
commit
12a604fec8
BIN
fonts/NotoSerifHebrew-Bold.ttf
Normal file
BIN
fonts/NotoSerifHebrew-Bold.ttf
Normal file
Binary file not shown.
BIN
fonts/NotoSerifHebrew-Regular.ttf
Normal file
BIN
fonts/NotoSerifHebrew-Regular.ttf
Normal file
Binary file not shown.
BIN
tests/ref/text/bidi.png
Normal file
BIN
tests/ref/text/bidi.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
49
tests/typ/text/bidi.typ
Normal file
49
tests/typ/text/bidi.typ
Normal file
@ -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חיים
|
@ -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.
|
||||
ب🐈😀سم
|
||||
|
Loading…
x
Reference in New Issue
Block a user