Skip to main content

Crate xgpui_parley

Crate xgpui_parley 

Source
Expand description

Experimental Parley interop: flat LTR lines, resolved-face metrics and grayscale rasterization, with an opt-in PlatformTextSystem backend.

Re-exports§

pub use typeset::Typeset;
pub use typeset::typeset;

Modules§

typeset
typeset(): a text element shaped by the installed Parley engine.

Structs§

FaceRegistry
Registry of resolved font instances. IDs are stable for this registry’s lifetime and must not be shared with another registry or reused after reset. Retain one registry per text backend, not per line or frame.
GlyphRasterizer
Grayscale outline and color glyph rasterization. Retain one instance per backend/scaler thread. Retains 64 hinting instances and one prepared outline for bounds-to-raster reuse. GPUI’s TextSystem and sprite atlas retain bounds and final glyph bitmaps.
ParagraphLayout
One immutable reflow, used for every geometry query in this text revision.
ParagraphOptions
Paragraph-wide options that affect shaping and line breaking.
ParagraphShape
Immutable shaped data. Caller retains it across width changes; no cache here.
ParleyTextSystem
Experimental flat-LTR backend with an opt-in paragraph path. Select fonts before constructing GPUI; GPUI owns the font-metric, line-layout, wrapping and final raster caches.
RegisteredFace
Font bytes, collection index and variation location used by shaping. Rasterization uses this instance rather than resolving a family again.
TextLanguage
A content language parsed from a BCP 47 tag.
TextPosition
Paragraph-relative UTF-8 position; providers validate and snap cluster edges.
VariationPreview
A preview policy for one fixed font descriptor and one bounded set of requested instances. Quantization happens before font resolution, so shaping and rendering see the same coordinates. No font IDs or atlas tiles are evicted.

Enums§

TextDirection
Base direction of a paragraph: the order of its lines’ runs and its start edge.
VisualDirection
Physical horizontal movement, independent of logical text direction.

Functions§

line_layout
Convert a scale-1, start-aligned Parley line into GPUI’s baseline-relative glyph records. The caller owns/reuses Parley’s font and layout contexts.

Type Aliases§

LayoutErrorHandler
Called on an uncached rejected layout, outside the backend lock. No source text is included in the diagnostic. Install before constructing GPUI caches.