Skip to content
bidi

bidi

Mojo module 🡭

bidi

Unicode bidirectional layout for mixed-direction text.

Implements UAX #9 embedding, weak and neutral resolution, bracket mirroring, and visual reordering using Unicode 15.0 data. Reordering is cluster-aware so combining marks remain with their base character. Arabic contextual shaping is handled separately by joining.mojo.

Structs

  • BidiRun: One maximal span of a line at a single embedding level. codepoints[start] through codepoints[start + length - 1] are the run’s characters in logical order; an odd level means the run draws right to left, so its glyphs reverse after they are shaped.

Functions