Commit 25aa9c7
committed
AtlasEngine: Honor bidi/script boundaries in upstream segmentation
The previous RTL implementation ran AnalyzeBidi and AnalyzeScript inside
_mapComplex, after font fallback and complexity analysis had already
segmented the text. When those upstream segmenters split a direction-
uniform region (e.g. at a space or attribute change), each fragment
re-analyzed in isolation and fell back to LTR.
This commit inverts the order so analysis is authoritative:
- Run AnalyzeScript + AnalyzeBidi once on the whole buffer line in
_flushBufferLine.
- Add _nextAnalysisBoundary so font fallback and GetTextComplexity
clamp every segment at the next script/bidi run end.
- _mapComplex receives ranges guaranteed uniform in script and
direction; the inline analysis call, the per-script-run loop, and
the "mixed -> LTR" fallback are removed.
Hebrew text with embedded spaces and mixed LTR/RTL lines now shape
correctly.1 parent 423edc7 commit 25aa9c7
2 files changed
Lines changed: 214 additions & 178 deletions
0 commit comments