Single-line bidirectional run ordering¶
Optional bidi::BidiLine resolves one complete line before shaping with the
pinned unicode-bidi 0.3.18 Unicode 16.0 data. Supply an explicit base direction,
or use first-strong detection (LTR for no strong text). It retains borrowed text,
line-adjusted embedding levels per UTF8 byte and logical byte ranges in visual
run order. Feed each original run slice to the shaper with its resolved direction;
reversing characters first would break combining/contextual shaping. The shaper
handles mirroring/marks. Runs are directional boundaries, rather than font/script
boundaries; caller still segments scripts, chooses fallback/fonts/styles, maps
clusters and places/aligns complete lines.
Input is at most 4096 UTF8 bytes, output at most 512 directional runs after
backend work. Controls, Unicode line/paragraph separators and noncharacters
reject; directional formatting/isolate characters remain in logical source
ranges. TextFont::shape now also explicitly rejects Unicode separators, matching
its single-line contract. Empty lines retain explicit direction (default LTR).
No wrapping, paragraph/multiline layout, script/font fallback, caret/text input,
native/GPU/accessibility or global backend memory/time/deadline claim follows.
Thirty-two unchanged Unicode 16.0 reference vectors pass resolved base levels, character levels and visual order. Additional cases check isolates/combining/ byte-boundary coverage, auto/explicit base, empty lines, exact 512-run capacity and invalid separators. Reference data retains Unicode licence/provenance. The controlled example combines Arabic/Latin/numbers using local outlines:
CARGO_BUILD_JOBS=2 cargo run -p ravet-surface --features text \
--example bidi-outlines --locked -- /path/to/local.ttf > target/bidi-outlines.svg
See decision 0094. This is a scoped single-line fixture profile, rather than complete Unicode/UI conformance.