Skip to main content

VarcContext

Trait VarcContext 

Source
pub(crate) trait VarcContext {
    // Required methods
    fn coords(&self) -> &[F2Dot14];
    fn draw_glyph(
        &self,
        glyph: GlyphId,
        coords: &[F2Dot14],
        ppem: Option<f32>,
        buf: &mut [u8],
        sink: &mut dyn PathSink,
    ) -> Result<(), Error>;
    fn glyph_buffer_size(&self, glyph: GlyphId) -> usize;
}
Expand description

Provides the data that Outlines::draw needs from outside the table.

This includes the font’s location and the glyphs at the leaves of a composite.

Required Methods§

Source

fn coords(&self) -> &[F2Dot14]

Returns the normalized variation coordinates of the font’s location.

A component that resets unspecified axes uses these values.

Source

fn draw_glyph( &self, glyph: GlyphId, coords: &[F2Dot14], ppem: Option<f32>, buf: &mut [u8], sink: &mut dyn PathSink, ) -> Result<(), Error>

Draws glyph into sink at the normalized coordinates coords.

The coords may differ from Self::coords. ppem is the size of the composite, or None for font units. buf is working memory of at least Self::glyph_buffer_size bytes for the glyph.

Source

fn glyph_buffer_size(&self, glyph: GlyphId) -> usize

Returns the size in bytes of the working memory needed to draw glyph.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§