Skip to main content

Module text

Module text 

Source
Expand description

Text layout: the one thing a drawing cannot do for itself.

Shaping, kerning and line breaking come from the host’s own text engine rather than from an approximation of it, so a diagram exported with different line breaks than the canvas showed is unrepresentable. The backend implements TextLayout; the export consumes it.

Structs§

Glyph
One placed glyph. A layout records the character a glyph stands for, not the glyph a shaper chose for it, so a many-to-one substitution arrives as its head plus zero-advance continuations.
GlyphId
A glyph’s index in its face — the identity a shaper resolves, which the character alone does not carry: fi in a face with liga is one glyph filed under two characters.
Layout
A laid-out run: what it measures, and where every glyph in it landed.
Row
One row of a Layout.

Constants§

COLUMN_GLYPH
The glyph one column of a font is as wide as — the one CSS’s ch unit measures.

Traits§

TextLayout
A host’s text engine, as the exporters need to read it.