Expand description
Phase 3: Layout and Soft Wrapping (Headless Layout Engine)
Calculates the visual representation of text given a container width. Computes character widths based on UAX #11 and implements headless reflow algorithm.
Structs§
- Layout
Engine - Layout engine - manages visual representation of all lines
- Visual
Line Info - Visual line information
- Wrap
Point - Wrap point
Constants§
- DEFAULT_
TAB_ WIDTH - Default tab width (in cells) used when a caller does not specify a tab width.
Functions§
- calculate_
wrap_ points - Calculate wrap points for text
- calculate_
wrap_ points_ with_ tab_ width - Calculate wrap points for text, interpreting
'\t'usingtab_width. - cell_
width_ at - Calculate visual width (in cells) for a character at a specific cell offset within the line.
- char_
width - Calculate visual width of a character (based on UAX #11)
- str_
width - Calculate total visual width of a string
- str_
width_ with_ tab_ width - Calculate total visual width of a string, interpreting
'\t'usingtab_width. - visual_
x_ for_ column - Calculate the visual cell offset from the start of the line to the given character column.