Expand description
Text measurement, layout, wrapping, and editing for Ailloli UI.
Decoupled from the GPU backend: this crate produces PreparedTextLayout and
GlyphInstance data; ailloli_ui_render_wgpu rasterizes glyphs into an atlas.
§Main types
| Type | Role |
|---|---|
TextSystem | Per-window Parley engine + LRU layout cache + font blobs |
TextBuffer | Rope-backed document with per-paragraph revisions |
PreparedTextLayout | Cached layout + glyphs for DrawCmd::Text |
TextEditState | Caret, selection, IME, undo/redo for text widgets |
Re-exports§
pub use buffer::ParagraphMeta;pub use buffer::TextBuffer;pub use edit::PlatformKeymap;pub use edit::TextEditAction;pub use edit::TextEditOutcome;pub use edit::TextEditState;pub use edit::TextInputMode;pub use edit::TextKeymap;pub use edit::TextMovement;pub use edit::TextSelection;pub use engine_parley::ParleyEngine;pub use font_db::FontDb;pub use glyph::GlyphInstance;pub use layout::caret_index_at_point;pub use layout::caret_rect_at;pub use layout::caret_x_at;pub use layout::layout_text;pub use layout::LaidOutLine;pub use layout::LaidOutText;pub use layout::TextLayoutParams;pub use layout::TextMetrics;pub use layout::WrapMode;pub use params::StyledTextLayoutParams;pub use params::StyledTextSpan;pub use prepared::prepare_layout;pub use prepared::PreparedTextLayout;pub use system::ParagraphStore;pub use system::TextLayoutHandle;pub use system::TextLayoutKey;pub use system::TextSystem;pub use text_layout::caret_index_at_x;pub use text_layout::line_layout;pub use text_layout::LineLayout;pub use text_measure::ApproxTextMeasure;pub use text_measure::FontMetrics;pub use text_measure::TextMeasure;pub use wrap::wrap_lines;
Modules§
- buffer
- Rope buffer with paragraph indexing and targeted invalidation. Rope-backed text buffer with per-paragraph revision tracking.
- edit
- Keyboard/IME editing engine shared by
TextInputandEditor. Text editing engine: caret, selection, IME, undo/redo, clipboard. - engine_
parley - Low-level Parley layout engine wrapper. Stateful Parley adapter used by higher-level text systems.
- font_db
- Font discovery via
fontique(system + bundled assets). Fontique-backed discovery for bundled and operating-system fonts. - glyph
- Glyph positions for GPU atlas lookup. Backend-neutral glyph placement produced by the text layout pipeline.
- layout
- Parley-based layout helpers and caret mapping. Cluster-aware shaping, line metrics, glyph extraction, and caret mapping.
- params
- Layout request parameters and line metrics. Value types that describe layout requests and results.
- prepared
- Prepared layouts ready for paint. One-shot prepared text layout: glyphs without per-instance font byte copies.
- system
- Central text subsystem (cache + fonts). Central text subsystem: shared Parley engine, layout LRU cache, font blobs per face.
- text_
layout - Simple per-line metrics (fontdue-backed). Simple per-character layout helpers independent of Parley shaping.
- text_
measure - Width measurement trait and implementations. Width measurement abstractions for lightweight text helpers.
- wrap
- Word-wrap without hyphenation. Lightweight whitespace-normalizing word wrapping.