Expand description
Text wrapping utilities shared by layout (measuring) and render (drawing).
Constants§
- CHAR_W
- Approximate pixel width per character at font_scale=1.0 in Minecraft’s default font.
- LINE_
GAP - Gap between wrapped lines.
- LINE_H
- Line height at font_scale=1.0.
Functions§
- line_
count - Number of lines that
textwraps to. - paginate_
text - Split
textinto page-sized chunks that fit withinmax_hpixels. Each page is aVec<String>of ready-to-render lines. - text_
height - Total pixel height of wrapped
text. - wrap_
text - Break
textinto lines that fit withinmax_wpixels atfont_scale. All comparisons are char-count based (Unicode-safe).