Expand description
Renderer-independent text primitives and cached logical text layout.
The public surface is split into small modules so consumers can use the
text model (spans), editor state (editing), and shaping engine
independently. Existing font/layout exports remain available at the crate
root for backwards compatibility.
Structs§
- Editable
Text - A renderer-neutral editable text description.
- Font
Feature - OpenType font feature setting with a 4-byte ASCII tag and an integer value.
- FontId
- Stable renderer-independent identity for a loaded font asset.
- Font
RunDebug - Font
Variation - OpenType font variation axis setting with a 4-byte ASCII tag and floating-point value.
- Font
Weight - Font weight values (1..1000).
- Icon
Data - Immutable icon font metadata.
- Rich
Text - A rich paragraph with paragraph-level alignment and scaling.
- Strut
Style - Baseline strut configuration defining minimum vertical line spacing.
- Text
- A plain paragraph description. Rendering code can turn it into a
TextSpanwithout losing the familiarText::new("...")API. - Text
Caret Position - A visual insertion point emitted by the shaping engine.
- Text
Cluster Span - A shaped cluster’s selectable source coverage, in text-area coordinates
with
left <= right. Spans follow visual order, so a logical byte range can cover several disjoint spans in mixed-direction text. Consumers merge spans intersecting a selection instead of assuming the range maps to one rectangle. Zero-advance clusters are kept because they still own caret stops; selection ignores them. - Text
Decoration - Visual line decorations for rendered text.
- Text
Diagnostics - Layout/cache counters. Legacy field names are retained for source compatibility; Parley performs fallback and coverage resolution internally.
- Text
Document Layout - Text laid out one hard-broken paragraph at a time.
- Text
Editing Controller - Cloneable editing controller. It owns no platform resources; platform and widget layers can subscribe to value changes and decide when to repaint.
- Text
Editing Delta - An atomic editing operation, useful for integrating native IMEs and undo stacks without coupling those systems to a widget.
- Text
Editing Subscription - Owns a text-controller listener until dropped.
- Text
Editing Value - Text
Engine - The sole owner of font discovery and app-registered fonts. Parley owns the actual font collection and resolves scripts, bidi direction and fallback.
- Text
Field - Convenience text-field configuration built on
EditableText. - Text
Height Behavior - Controls line-box height calculations for first ascent and last descent.
- Text
Layout - Text
Layout Options - Paragraph-level layout controls. They deliberately describe behavior in Incular terms and do not expose Parley builder types.
- Text
Line - Text
Line Ref - A line of laid-out text in layout coordinates: byte offsets index the laid-out text and vertical positions are measured from its top.
- Text
Lines - Iterator over the lines of a
TextGeometry. - Text
Metrics - Text
Range - A half-open UTF-8 byte range. Text engines use byte offsets so ranges can
be passed directly to shaping and grapheme segmentation without lossy
conversions. Call
Self::clamp_tobefore slicing arbitrary user input. - Text
Scaler - Text scaling policy applied after a style’s logical font size is chosen.
- Text
Selection - A selection preserves directional base/extent while exposing a normalized range for text replacement.
- Text
Span - A recursively nestable text node. Styles are inherited by descendants; inline widget spans occupy one object-replacement character in plain text.
- Text
Style - An immutable, Flutter-style text style description.
- Widget
Span - A widget-independent inline child. The text crate stores a stable identity
and measured size rather than depending on
incular-widgets, which keeps the crate graph acyclic. Widgets can resolve the identity during layout.
Enums§
- Font
Family - A logical font family. Named families are resolved by
crate::TextEngine; their names are shared, so cloning a style never copies them. - Font
Style - Inline
Span - A node in a rich text tree.
- Line
Height - Explicit text line height representation.
- Selection
Changed Cause - Text
Affinity - Whether a caret is associated with the leading or trailing edge of a bidirectional run.
- Text
Align - Text
Baseline - The baseline alignment policy.
- Text
Boundary Kind - The string-only boundary kinds a caret can move or delete by.
- Text
Decoration Style - Visual stroke pattern for text decorations.
- Text
Leading Distribution - The leading distribution policy between line boxes.
- Text
Overflow - What to do when a paragraph cannot fit its configured line or width limit.
- Text
Scaler Kind - Text
Width Basis - Strategy for measuring paragraph width bounds.
- Widget
Span Alignment
Traits§
- Text
Geometry - Line geometry of laid-out text: lines in layout coordinates, their caret stops and the overall metrics.
- Text
Span Visitor - Visitor for rich text leaves. Both methods have defaults so callers can collect only the kind of leaf they need.
Functions§
- is_
layout_ whitespace - Flutter’s
TextLayoutMetrics.isWhitespacefor one character. - register_
application_ font - Registers a TrueType/OpenType font with every
TextEngineon the calling (UI) thread, including engines created earlier. - set_
missing_ characters_ listener - Calls
listeneron the calling (UI) thread after a layout finds characters no font could draw. The listener runs during layout: it should only schedule work, then collect the characters withtake_missing_characters. Hosts without system fonts use this to load a font that covers them andregister_application_fontit. - set_
word_ segmenter - Replaces word segmentation on the calling (UI) thread.
segmentreturns the ascending UTF-8 byte offsets of a text’s word boundaries, including0and its length, orNoneto use the built-in segmenter. - take_
missing_ characters - Returns the characters this thread’s layouts drew with a missing glyph since the last call. Each character is reported once per thread, even if no font ever covers it.
- word_
boundary_ at - Flutter’s
TextPainter.getWordBoundary: the UAX #29 word segment that containsoffset(whitespace and punctuation runs are segments too), as a(start, end)byte range. An offset at the end of the text yields the empty range there.
Type Aliases§
- Composing
Range - A composing/marked range supplied by an IME.
- Text
Shadow - Compatibility spelling for the renderer-owned canonical shadow value. Text must not maintain a second color/offset/blur representation.