pub trait GlyphRenderer {
// Required methods
fn fill_glyph(&mut self, glyph: PreparedGlyph<'_>);
fn stroke_glyph(&mut self, glyph: PreparedGlyph<'_>);
fn take_glyph_caches(&mut self) -> GlyphCaches;
fn restore_glyph_caches(&mut self, caches: GlyphCaches);
}Expand description
Trait for types that can render glyphs.
Required Methods§
Sourcefn fill_glyph(&mut self, glyph: PreparedGlyph<'_>)
fn fill_glyph(&mut self, glyph: PreparedGlyph<'_>)
Fill glyphs with the current paint and fill rule.
Sourcefn stroke_glyph(&mut self, glyph: PreparedGlyph<'_>)
fn stroke_glyph(&mut self, glyph: PreparedGlyph<'_>)
Stroke glyphs with the current paint and stroke settings.
Sourcefn take_glyph_caches(&mut self) -> GlyphCaches
fn take_glyph_caches(&mut self) -> GlyphCaches
Takes the glyph caches from the renderer for use in a glyph run.
NOTE: The caller must restore the caches after the glyph run is done.
Sourcefn restore_glyph_caches(&mut self, caches: GlyphCaches)
fn restore_glyph_caches(&mut self, caches: GlyphCaches)
Restores the glyph caches after a glyph run.
The caches must have been previously taken with take_glyph_caches.