Expand description
Parley 0.11 text pipeline for Frust.
Wraps parley’s font matching and layout into a small, renderer-agnostic
surface: TextContext owns the heavyweight font/layout state,
TextStyle carries the styling knobs (family/weight/style/size/color/
letter-spacing/line-height — the M3 type-scale surface), and TextLayout
is a finished, measurable block of text that converts into
frust_scene::GlyphRuns. Only kurbo/peniko/frust-scene types
appear in the public API — no vello, wgpu, or parley types leak through.
The parley -> vello glyph coordinate contract lives in
[convert].
Structs§
- Editing
State - The editing value in UTF-16 code-unit offsets — the Flutter-canonical
shape the Android/iOS bridges exchange (
-1denotes “none”). - Editing
State Bytes - The editing value in byte offsets — the parley-native representation and
the shape
EditOp::ApplyEditingStateconsumes. - Font
Weight - Visual weight of a font, on the standard 1-1000 CSS
font-weightscale. - Registered
Family - A font family registered via
TextContext::register_fonts, reported back to the caller so it can resolve widget styles against the exact name(s) fontique assigned. - Shape
Cache Stats - Instrumentation counters for the shape cache — the observable hook the shape-cache tests assert against, and a perf signal otherwise.
- Text
Context - Owns parley’s font matching and layout scratch state.
- Text
Editor - The editing engine wrapping a parley
PlainEditor. - Text
Layout - A finished text layout: positioned glyph runs plus a cached measured size.
- Text
Style - Styling applied uniformly to a laid-out string.
Enums§
- EditOp
- A single editing command applied to a
TextEditor. - Family
Name - One element of a fallback stack: a concrete family name or a generic class.
- Font
Error - Errors from
TextContext::register_fonts. - Font
Family - Font family selection.
- Font
Style - Visual slant of a font.
- Generic
Slot - Generic font families supported as fallback slots.
- Line
Height - Line height: how much vertical space each line of text occupies.
- Text
Align - Paragraph alignment: how each line is positioned within the layout’s width.
- Text
Overflow - How text that overflows a bounded [
TextContext::layout_bounded] (max_lines) is handled.
Functions§
- byte_
to_ utf16 - Converts a byte offset into
textto a UTF-16 code-unit offset. - register_
generic_ fallback - Registers
data(raw font bytes) as a fallback face for each generic family slot ingenerics, applied to everyTextContext— existing, on its nextTextContext::sync_app_fonts, and future, seeded for free byTextContext::new— viafontique::Collection::append_generic_families. - sanitize_
paste - Normalizes pasted text for insertion, handling line-ending differences.
- utf16_
to_ byte - Converts a UTF-16 code-unit offset into
textto a byte offset.