Skip to main content

WispTextRenderer

Trait WispTextRenderer 

Source
pub trait WispTextRenderer {
    // Required method
    fn draw(&self, layout: &dyn WispTextLayout, text: &WispText);
}
Expand description

Text renderer — consumes a layout and emits GPU draw calls.

target_width_ndc and target_height_ndc describe the destination surface so the renderer can convert NDC sizes back into pixels for glyph rasterization (matters for FlexibleText — atlas text is already-rasterized).

Required Methods§

Source

fn draw(&self, layout: &dyn WispTextLayout, text: &WispText)

Draw layout at text.position (NDC). Implementations are expected to short-circuit no-ops gracefully (empty content, out-of-view position, etc.).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§