Skip to main content

GlyphRunBackend

Trait GlyphRunBackend 

Source
pub trait GlyphRunBackend<'a>: Sized {
    // Required methods
    fn atlas_cache(self, enabled: bool) -> Self;
    fn fill_glyphs<Glyphs>(self, run: GlyphRun<'a>, glyphs: Glyphs)
       where Glyphs: Iterator<Item = Glyph> + Clone;
    fn stroke_glyphs<Glyphs>(self, run: GlyphRun<'a>, glyphs: Glyphs)
       where Glyphs: Iterator<Item = Glyph> + Clone;
    fn render_decoration<Glyphs>(
        self,
        run: GlyphRun<'a>,
        glyphs: Glyphs,
        x_range: RangeInclusive<f32>,
        baseline_y: f32,
        offset: f32,
        size: f32,
        buffer: f32,
    )
       where Glyphs: Iterator<Item = Glyph> + Clone;
}
Expand description

A backend for glyph run builders.

Required Methods§

Source

fn atlas_cache(self, enabled: bool) -> Self

Enable or disable atlas-backed glyph caching for the glyph run.

Note: Atlas caching is currently highly experimental and not recommended for external use.

Source

fn fill_glyphs<Glyphs>(self, run: GlyphRun<'a>, glyphs: Glyphs)
where Glyphs: Iterator<Item = Glyph> + Clone,

Fill the given glyph sequence using the configured builder state.

Source

fn stroke_glyphs<Glyphs>(self, run: GlyphRun<'a>, glyphs: Glyphs)
where Glyphs: Iterator<Item = Glyph> + Clone,

Stroke the given glyph sequence using the configured builder state.

Source

fn render_decoration<Glyphs>( self, run: GlyphRun<'a>, glyphs: Glyphs, x_range: RangeInclusive<f32>, baseline_y: f32, offset: f32, size: f32, buffer: f32, )
where Glyphs: Iterator<Item = Glyph> + Clone,

Render a decoration (e.g. underline) with skip-ink behavior.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§