Skip to main content

Module text

Module text 

Source
Expand description

Floem’s high-level text API.

This module exposes the text types used by Floem views and editor code:

  • styling attributes and font vocabulary re-exported from floem_renderer::text
  • Parley alignment, cursor, selection, and wrapping vocabulary used directly by Floem
  • TextLayout, Floem’s layout wrapper around Parley
  • TextLayoutState, shared view state for overflow-aware text layout

TextLayout deliberately hides Parley’s concrete layout type from most callers while still using Parley’s lower-level vocabulary types.

Structs§

Attrs
Text styling attributes used to configure font properties, color, and layout.
AttrsList
A list of text attributes with default styling and per-range overrides.
AttrsOwned
An owned version of Attrs that does not borrow the font family slice.
Cursor
Defines a position with a text layout.
FontWeight
Visual weight class of a font, typically on a scale from 1.0 to 1000.0.
FontWidth
Visual width of a font– a relative change from the normal aspect ratio, typically in the range 0.5 to 2.0.
Glyph
Glyph with an offset and advance.
GlyphRunProps
Rendering properties shared by a glyph run.
Selection
Defines a range within a text layout.
TextLayout
A Floem wrapper around a Parley text layout.
TextLayoutState
Shared text layout state used by text-based views.
TextOverflowChanged
Event fired when a text view’s overflow state changes.
TextSelection
A TextLayout-owned selection value.

Enums§

Affinity
Determines how a cursor attaches to a cluster.
Alignment
Alignment of a layout.
FamilyOwned
An owned font family identifier.
FontStyle
Visual style or ‘slope’ of a font.
LineHeightValue
Specifies how line height is computed for text layout.
OverflowWrap
Control over “emergency” line-breaking.
TextWrapMode
Control over non-“emergency” line-breaking.
WordBreakStrength
Word breaking strength (corresponds to https://drafts.csswg.org/css-text/#word-break-property).

Statics§

FONT_CONTEXT
Shared Parley font context used by Floem text layout construction.

Functions§

paragraph_ranges
Returns the byte ranges of the source text’s logical paragraphs.

Type Aliases§

NormalizedCoord
Variable font design-space coordinate.