Expand description
Shared display width helpers for layout and rendering.
This module centralizes glyph width calculation so layout (ftui-text) and rendering (ftui-render) stay in lockstep. It intentionally avoids ad-hoc emoji heuristics and relies on Unicode data tables.
Functionsยง
- ascii_
width - Fast-path width for pure printable ASCII.
- char_
width - Width of a single Unicode scalar.
- cjk_
width_ enabled - Cached CJK width policy (fast path).
- cjk_
width_ from_ env - Compute CJK width policy using a custom environment lookup.
- display_
width - Width of a string in terminal cells.
- grapheme_
width - Width of a single grapheme cluster.
- vs16_
trust_ from_ env - Compute VS16 trust policy using a custom environment lookup (testable).
- vs16_
width_ trusted - Cached VS16 width trust policy (fast path).