Module text
Expand description
Optional local-font single-run shaping on UI/worker threads.
Font loading/shaping allocates and may run backend work beyond output limits;
neither belongs in an audio callback. No font discovery/network access,
implicit fallback or native UI is added by single-font shaping. The explicit
crate::fallback module selects from caller-supplied local fonts. The separate raster feature can
explicitly render prepared local-font outlines. Independent runs do not wrap;
crate::paragraph supplies explicit bounded wrapping. Single-line bidi
ordering is available separately in crate::bidi.
Structs§
- Shaped
Glyph - Positioned glyph in visual order, with UTF8 byte cluster and scaled font-unit advances/offsets. Y points up; renderer owns any baseline/coordinate transform. Glyph zero is the missing-glyph result; no fallback face is selected.
- Shaped
Text - Owned shaped run. Advance is pen movement, rather than glyph ink bounds.
- Text
Feature - Explicit global OpenType feature override; printable ASCII tag, max 32/run.
- Text
Font - Owned local font at an explicit immutable variation instance; from_bytes selects defaults. Parsing/caching may allocate. Backend-supported formats/faces only; parsing is not full corruption validation. The consumer owns font licensing, fallback selection and rendered font identity.
- Text
Options - Single horizontal run options. Size is finite (0,1024] caller-selected units. Script may be guessed from the run; language is an optional ASCII alphanumeric/ hyphen tag of 1..63 bytes. This does not perform full BCP47 validation.
- Text
Variation - Explicit user-space coordinate. Unknown/duplicate/out-of-range tags reject.
- Text
Variation Axis - Exact fvar 16.16 bounds represented in f64; hidden is a UI recommendation.
- Text
Variation Coordinate - Requested f32 user coordinate and actual backend normalized 2.14 coordinate. Backend user-space 16.16 rounding/avar mapping may change the latter.
Enums§
- Text
Direction - Direction belongs to the caller’s script/bidi segmentation, not auto detection.
- Text
Error - Text
Outline Format - Selected scalable source table; metadata admission does not validate every glyph.
Constants§
- MAXIMUM_
FONT_ BYTES - Font bytes accepted before copying/parsing.
- MAXIMUM_
SHAPED_ GLYPHS - Returned glyphs; backend transient memory/time is not globally bounded here.
- MAXIMUM_
TEXT_ BYTES - UTF8 bytes per independent horizontal run.
- MAXIMUM_
TEXT_ VARIATIONS - Maximum explicit OpenType variation axes/settings per immutable instance.