Expand description
Text element — renders text with template variable resolution, word wrapping, alignment, and colour mapping.
§Features
- Template variable resolution via
DataContext::resolve - Word wrapping when
TextParams::wrapistrue - Left / centre / right alignment within the element rect
- Colour mapping from named ink-ramp strings and
#RRGGBBhex literals
Functions§
- align_
offset - Compute horizontal tile offset for a given alignment.
- parse_
color - Parse a colour string to an
Rgba. - render_
text - Render a text element into the framebuffer via
painter. - word_
wrap - Word-wrap
textto fit withinmax_charsper line, breaking at space boundaries when possible. Words longer than a line are hard-broken. - word_
wrap_ px - Word-wrap
textto a pixelmax_pxwidth using the painter’s proportional font metrics (Painter::measure_text_px). Breaks at spaces where possible; a run wider than a line (e.g. CJK with no spaces) is split per-character by measured width. Explicit\nstart new lines. Used by the proportional path.