pub trait Renderer: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn render(
&self,
shaped: &ShapingResult,
font: Arc<dyn FontRef>,
params: &RenderParams,
) -> Result<RenderOutput>;
// Provided methods
fn supports_format(&self, _format: &str) -> bool { ... }
fn clear_cache(&self) { ... }
}Expand description
Where glyphs become visible
Rasterizers turn positioned glyphs into pixels. Vector renderers turn them into paths. Both implement this trait.
Required Methods§
Sourcefn render(
&self,
shaped: &ShapingResult,
font: Arc<dyn FontRef>,
params: &RenderParams,
) -> Result<RenderOutput>
fn render( &self, shaped: &ShapingResult, font: Arc<dyn FontRef>, params: &RenderParams, ) -> Result<RenderOutput>
Convert glyphs to visual output
Provided Methods§
Sourcefn supports_format(&self, _format: &str) -> bool
fn supports_format(&self, _format: &str) -> bool
Do you understand this output format?
Returns false by default - implementations should explicitly declare support.
Sourcefn clear_cache(&self)
fn clear_cache(&self)
Free up rendering resources