typst/tests/typ/text/shaping.typ
bluebear94 ce658db2f3
ShapedText::push_hyphen: Use self.base for default hyphen range (#2299)
In the unlikely chance that we hyphenate after an empty line, we
set the glyph range to self.base..self.base so that subtracting

Fixes #2283.
2023-10-03 15:02:27 +02:00

35 lines
837 B
Typst
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Test shaping quirks.
---
// Test separation by script.
ABCअपार्टमेंट
// This is how it should look like.
अपार्टमेंट
// This (without the spaces) is how it would look
// if we didn't separate by script.
पा र् में
---
// A forced `latn` script inhibits Devanagari font features.
#set text(script: "latn")
ABCअपार्टमेंट
---
// A forced `deva` script enables Devanagari font features.
#set text(script: "deva")
ABCअपार्टमेंट
---
// Test that RTL safe-to-break doesn't panic even though newline
// doesn't exist in shaping output.
#set text(dir: rtl, font: "Noto Serif Hebrew")
\ ט
---
// Test that #2283 is fixed.
#set text(font: "test", lang: "de", hyphenate: true, fallback: false)
#set par(linebreaks: "simple")
- ensure