M4: right-to-left and mixed-direction text (Unicode bidi) (#34)

Text runs get bidi embedding levels from the Unicode bidi algorithm
(unicode-bidi, MIT/Apache-2.0). Right-to-left runs are shaped right to
left, kept in logical order for line breaking and placed in visual order
per line (rule L2, trailing spaces at the paragraph level). Glyphs and
lines know their direction, so the caret, clicks and selection
highlights follow right-to-left runs. Text without right-to-left
characters skips the analysis.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
BFlat
2026-10-10 05:12:14 +07:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 1c6f04bf62
commit 632c5ffc16
7 changed files with 204 additions and 17 deletions
+1
View File
@@ -43,6 +43,7 @@ usvg = "0.48"
krilla = "0.8"
skrifa = "0.47"
harfrust = "0.13"
unicode-bidi = "0.3"
linesweeper = "0.4"
zip = { version = "2", default-features = false, features = ["deflate"] }
sha2 = "0.10"