Commit 13f06b9
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.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent ff22ca5 commit 13f06b9
2 files changed
Lines changed: 214 additions & 178 deletions
0 commit comments