code wiki / (root) / nx_text_wrap.nx

nx_text_wrap.nx

buildroot/runtime/nx_text_wrap.nx

1377 B22 linesdepth 2pulls 2 transitivereach 93 importersview sourcekind librarytopic text
docsdependenciesstructsconstsfunctions

about

nx_text_wrap.nx -- SHARED word-level line breaking for the renderer. LAYOUT (height reservation in nx_layout_block) and PAINT (glyph drawing in nx_paint_walk_layout) MUST agree on exactly where lines break, else reserved line-count != painted line-count -> vertical overlap/gaps. So both call this ONE function. Greedy word wrap: a line beginning at `start` extends as far as possible without exceeding `cpl` chars, breaking AFTER the last space within [start, start+cpl]; a word longer than cpl is hard-broken at start+cpl (so progress is guaranteed). Returns the line's END index (exclusive). 100% sovereign. license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_text_wrap.nx nx_layout_block.nx nx_paint_walk_layout.nx nx_text_wrap_gate.nx

imports: nx_syscalls.nx

imported by: nx_layout_block.nxnx_paint_walk_layout.nxnx_text_wrap_gate.nx

structs

none

consts

none

functions

10func tw_next_break(text: *u8, len: i64, cpl: i64, start: i64) -> i64