Rich Text
A text element can carry styled runs โ bold, italic, color, underline / strikethrough on part of its string. Runs are an additive overlay: the element's flat text stays the source of truth, and an element without runs renders as one uniform style.
Text Measurement
Accurate text width matters: the selection box has to hug the rendered glyphs, and wrapping depends on real advances. The editor measures text through a pluggable shaper so the selection bounds match whichever backend actually draws the text.
Text Shape
Text is a first-class element type. A text element carries its string, font, and style (plus optional styled runs); the renderer measures and draws it with the bundled fonts so it looks identical across the Canvas2D, WebGL2, and offscreen backends.