AUDIO
Source snapshot · 12 October 2026

API reference / ravet_surface::text

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§

ShapedGlyph
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.
ShapedText
Owned shaped run. Advance is pen movement, rather than glyph ink bounds.
TextFeature
Explicit global OpenType feature override; printable ASCII tag, max 32/run.
TextFont
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.
TextOptions
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.
TextVariation
Explicit user-space coordinate. Unknown/duplicate/out-of-range tags reject.
TextVariationAxis
Exact fvar 16.16 bounds represented in f64; hidden is a UI recommendation.
TextVariationCoordinate
Requested f32 user coordinate and actual backend normalized 2.14 coordinate. Backend user-space 16.16 rounding/avar mapping may change the latter.

Enums§

TextDirection
Direction belongs to the caller’s script/bidi segmentation, not auto detection.
TextError
TextOutlineFormat
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.