Skip to main content

Crate incular_text

Crate incular_text 

Source
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§

EditableText
A renderer-neutral editable text description.
FontFeature
OpenType font feature setting with a 4-byte ASCII tag and an integer value.
FontId
Stable renderer-independent identity for a loaded font asset.
FontRunDebug
FontVariation
OpenType font variation axis setting with a 4-byte ASCII tag and floating-point value.
FontWeight
Font weight values (1..1000).
IconData
Immutable icon font metadata.
RichText
A rich paragraph with paragraph-level alignment and scaling.
StrutStyle
Baseline strut configuration defining minimum vertical line spacing.
Text
A plain paragraph description. Rendering code can turn it into a TextSpan without losing the familiar Text::new("...") API.
TextCaretPosition
A visual insertion point emitted by the shaping engine.
TextClusterSpan
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.
TextDecoration
Visual line decorations for rendered text.
TextDiagnostics
Layout/cache counters. Legacy field names are retained for source compatibility; Parley performs fallback and coverage resolution internally.
TextDocumentLayout
Text laid out one hard-broken paragraph at a time.
TextEditingController
Cloneable editing controller. It owns no platform resources; platform and widget layers can subscribe to value changes and decide when to repaint.
TextEditingDelta
An atomic editing operation, useful for integrating native IMEs and undo stacks without coupling those systems to a widget.
TextEditingSubscription
Owns a text-controller listener until dropped.
TextEditingValue
TextEngine
The sole owner of font discovery and app-registered fonts. Parley owns the actual font collection and resolves scripts, bidi direction and fallback.
TextField
Convenience text-field configuration built on EditableText.
TextHeightBehavior
Controls line-box height calculations for first ascent and last descent.
TextLayout
TextLayoutOptions
Paragraph-level layout controls. They deliberately describe behavior in Incular terms and do not expose Parley builder types.
TextLine
TextLineRef
A line of laid-out text in layout coordinates: byte offsets index the laid-out text and vertical positions are measured from its top.
TextLines
Iterator over the lines of a TextGeometry.
TextMetrics
TextRange
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_to before slicing arbitrary user input.
TextScaler
Text scaling policy applied after a style’s logical font size is chosen.
TextSelection
A selection preserves directional base/extent while exposing a normalized range for text replacement.
TextSpan
A recursively nestable text node. Styles are inherited by descendants; inline widget spans occupy one object-replacement character in plain text.
TextStyle
An immutable, Flutter-style text style description.
WidgetSpan
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§

FontFamily
A logical font family. Named families are resolved by crate::TextEngine; their names are shared, so cloning a style never copies them.
FontStyle
InlineSpan
A node in a rich text tree.
LineHeight
Explicit text line height representation.
SelectionChangedCause
TextAffinity
Whether a caret is associated with the leading or trailing edge of a bidirectional run.
TextAlign
TextBaseline
The baseline alignment policy.
TextBoundaryKind
The string-only boundary kinds a caret can move or delete by.
TextDecorationStyle
Visual stroke pattern for text decorations.
TextLeadingDistribution
The leading distribution policy between line boxes.
TextOverflow
What to do when a paragraph cannot fit its configured line or width limit.
TextScalerKind
TextWidthBasis
Strategy for measuring paragraph width bounds.
WidgetSpanAlignment

Traits§

TextGeometry
Line geometry of laid-out text: lines in layout coordinates, their caret stops and the overall metrics.
TextSpanVisitor
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.isWhitespace for one character.
register_application_font
Registers a TrueType/OpenType font with every TextEngine on the calling (UI) thread, including engines created earlier.
set_missing_characters_listener
Calls listener on 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 with take_missing_characters. Hosts without system fonts use this to load a font that covers them and register_application_font it.
set_word_segmenter
Replaces word segmentation on the calling (UI) thread. segment returns the ascending UTF-8 byte offsets of a text’s word boundaries, including 0 and its length, or None to 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 contains offset (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§

ComposingRange
A composing/marked range supplied by an IME.
TextShadow
Compatibility spelling for the renderer-owned canonical shadow value. Text must not maintain a second color/offset/blur representation.