diff --git a/fonts/NotoSerifHebrew-Bold.ttf b/fonts/NotoSerifHebrew-Bold.ttf new file mode 100644 index 000000000..e7cbd93ae Binary files /dev/null and b/fonts/NotoSerifHebrew-Bold.ttf differ diff --git a/fonts/NotoSerifHebrew-Regular.ttf b/fonts/NotoSerifHebrew-Regular.ttf new file mode 100644 index 000000000..27893f102 Binary files /dev/null and b/fonts/NotoSerifHebrew-Regular.ttf differ diff --git a/tests/ref/text/bidi.png b/tests/ref/text/bidi.png new file mode 100644 index 000000000..c3ad156b6 Binary files /dev/null and b/tests/ref/text/bidi.png differ diff --git a/tests/ref/text/shaping.png b/tests/ref/text/shaping.png index 88e7b0ad3..e6da3e4d2 100644 Binary files a/tests/ref/text/shaping.png and b/tests/ref/text/shaping.png differ diff --git a/tests/typ/text/bidi.typ b/tests/typ/text/bidi.typ new file mode 100644 index 000000000..44f0cc15d --- /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 567a208d2..5a469a456 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. ب🐈😀سم