Expand description
Flexible text renderer — glyphon rasterization (M-TEXT.3 / AUT-77).
Pairs with FlexibleTextEngine. The
engine produces FlexibleTextLayout shaped buffers; this
renderer hands those buffers to glyphon to rasterize into a
wgpu render target.
§Lifecycle
let engine = FlexibleTextEngine::new();
let renderer = FlexibleTextRenderer::new(&app, format,
engine.font_system_handle());
renderer.set_resolution(width_px, height_px);
let layout = engine.layout_concrete(&text);
renderer.draw(&target_view, &[(&layout, position_ndc, color)]);The engine and renderer share the same FontSystem through an
Arc<Mutex<…>> so layout-time metrics match the glyphs glyphon
eventually rasterizes.
§Why this is a sibling of Renderer, not a method on it
glyphon::TextRenderer keeps its own GPU pipeline + atlas separate
from wisp’s existing batching pipelines. Putting it on
crate::render::Renderer would force every renderer instance to
pay the glyphon initialization cost; instead we keep
FlexibleTextRenderer as an opt-in resource owned by whichever
caller needs it (the editor for caption rendering, the export path
for burn-in text, M-TEXT.5’s RT cache for filter/mask
composition).
Structs§
- Flexible
Text Renderer - Wgpu glyph rasterizer wrapping glyphon’s pipeline.