Text

:= []

Text module - fonts, text measurement, and prepared text drawing.

Measurement is a hosted effect. Prepare text once when content/style changes, then draw the prepared value without measuring again.

load_font! : LoadFont => Try(Font, [FontLoadFailed, ResourceLimit, ..])
Font : Font

Draw owns the host resource lifecycle; prepared text retains loaded fonts through the same ARC value as all other drawing APIs.

HAlign : [Left, Center, Right]
VAlign : [Top, Middle, Bottom]
Align : {
    horizontal : HAlign,
    vertical : VAlign,
}

Builder

Text.Builder :: # (opaque)
font : Builder, Font -> Builder
prepare! : Builder => Try(Prepared, [ResourceLimit, ..])

Cache immutable UTF-8 text, font/style, and measurement in the host.

Prepared

Text.Prepared :: # (opaque)

Host-owned immutable text. Its ARC handle retains any loaded font and its cached native NUL-terminated bytes are reused by every draw.