Expand description
Wisp text abstraction + backend boundary (M-TEXT.1 / AUT-75).
Backend modules live under this one — see atlas for the
bitmap-font path (M-TEXT.4 / AUT-78). M-TEXT.2/.3 will add a
flexible module wrapping cosmic_text + glyphon.
Wisp owns the text data model. App, editor, and project state never
see cosmic_text::* or glyphon::* types — they see WispText,
WispTextStyle, WispTextLayout, and a few related value types.
Backends (WispTextEngine + WispTextRenderer) plug in behind
this surface; today the only backend is the M0.15 bitmap path
(preserved as AtlasText in M-TEXT.4 / AUT-78). M-TEXT.2/.3 add a
Cosmic Text + Glyphon FlexibleText backend.
The boundary is what makes “improve text rendering” possible without a project-format breaking change.
§Type relationships
WispText { content, style, position }
│
│ engine.layout(text)
▼
Box<dyn WispTextLayout> ── line-broken, per-glyph data
│ metrics() (engine-specific concrete type)
│
▼
renderer.draw(layout, transform) ── GPU sideFor most users WispText is the only type they construct directly.
Backends are selected through whichever method on
crate::render::Renderer consumes the text (e.g. apply_atlas_text
today; apply_flexible_text after M-TEXT.3).
Re-exports§
pub use atlas::AtlasGlyphInstance;pub use atlas::AtlasTextEngine;pub use atlas::AtlasTextLayout;pub use caption::CaptionBlock;pub use caption::CaptionLayout;pub use flexible::FlexibleTextEngine;pub use flexible::FlexibleTextLayout;pub use flexible_renderer::FlexibleTextRenderer;pub use presets::TextPreset;pub use stroke::StrokedTextLayer;pub use stroke::stroked_text_sprites;pub use texture::TextTextureCache;pub use texture::TextTextureKey;pub use texture::TextTexturePipeline;
Modules§
- atlas
- Atlas text backend (M-TEXT.4 / AUT-78).
- caption
- Caption block — wrapped text on top of a rounded rect background (M-TEXT.9 / AUT-83).
- flexible
- Flexible text backend — Cosmic Text layout (M-TEXT.2 / AUT-76).
- flexible_
renderer - Flexible text renderer — glyphon rasterization (M-TEXT.3 / AUT-77).
- presets
- Curated
WispTextStylepresets for common screen-recording captions (M-TEXT.12 / AUT-86). - stroke
- Stroked / outlined text rendering (M-TEXT.7 / AUT-81).
- texture
- Text render-to-texture path (M-TEXT.5 / AUT-79).
Structs§
- Wisp
Font Handle - Font reference. Opaque identifier — the backend knows how to resolve
it. Atlas backend treats it as a slot id; Cosmic Text backend
treats it as a
Family + Weight + Stylequery. - Wisp
Text - User-facing text primitive. Owns content + style + position; the engine + renderer turn it into pixels.
- Wisp
Text Metrics - Layout-time metrics for a piece of text — output of
WispTextEngine::layout. - Wisp
Text Style - Style applied to a
WispText. Pure data — no third-party types.
Enums§
- Wisp
Font Style - Italic / oblique state.
- Wisp
Font Weight - Font weight on a 100..=900 scale matching CSS / OpenType.
- Wisp
Text Align - Horizontal alignment of laid-out lines within their box.
Traits§
- Wisp
Text Engine - Text-layout engine — turns a
WispTextinto a backend-specificWispTextLayoutimplementor. - Wisp
Text Layout - A laid-out piece of text — ready to be rendered.
- Wisp
Text Renderer - Text renderer — consumes a layout and emits GPU draw calls.