Zig-native implementation of the Unicode Bidirectional Algorithm (UAX #9).
Codepoint-level API with explicit allocator passing and no global state.
Why:
I needed bidi support for RTL text layout in Ghostty, and there wasn’t a pure Zig option. FriBidi and ICU work well, but they add C dependencies and don’t match Zig’s allocator-first style.
Key points:
- Full conformance in current suite:
BidiTest failed=0,BidiCharacterTest failed=0 - Competitive performance vs FriBidi/ICU across benchmark profiles
- Scratch APIs for allocation-light render loops
- Terminal-oriented
resolveVisualLayoutfor one-call line layout
Links:
- Repo: github.com/DiaaEddin/itijah
- Benchmarks: docs/benchmarks.md
- Ghostty integration PR (WIP, not merged): ghostty-org/ghostty#11079
Feedback welcome, especially from people working on text rendering in Zig.