skrifa

Trait MetadataProvider

source
pub trait MetadataProvider<'a>: Sized {
    // Required methods
    fn attributes(&self) -> Attributes;
    fn axes(&self) -> AxisCollection<'a>;
    fn named_instances(&self) -> NamedInstanceCollection<'a>;
    fn localized_strings(&self, id: StringId) -> LocalizedStrings<'a> ;
    fn metrics(
        &self,
        size: Size,
        location: impl Into<LocationRef<'a>>,
    ) -> Metrics;
    fn glyph_metrics(
        &self,
        size: Size,
        location: impl Into<LocationRef<'a>>,
    ) -> GlyphMetrics<'a>;
    fn charmap(&self) -> Charmap<'a>;
    fn outline_glyphs(&self) -> OutlineGlyphCollection<'a>;
    fn color_glyphs(&self) -> ColorGlyphCollection<'a>;
}
Expand description

Interface for types that can provide font metadata.

Required Methods§

source

fn attributes(&self) -> Attributes

Returns the primary attributes for font classification– stretch, style and weight.

source

fn axes(&self) -> AxisCollection<'a>

Returns the collection of variation axes.

source

fn named_instances(&self) -> NamedInstanceCollection<'a>

Returns the collection of named variation instances.

source

fn localized_strings(&self, id: StringId) -> LocalizedStrings<'a>

Returns an iterator over the collection of localized strings for the given informational string identifier.

source

fn metrics(&self, size: Size, location: impl Into<LocationRef<'a>>) -> Metrics

Returns the global font metrics for the specified size and location in normalized variation space.

source

fn glyph_metrics( &self, size: Size, location: impl Into<LocationRef<'a>>, ) -> GlyphMetrics<'a>

Returns the glyph specific metrics for the specified size and location in normalized variation space.

source

fn charmap(&self) -> Charmap<'a>

Returns the character to nominal glyph identifier mapping.

source

fn outline_glyphs(&self) -> OutlineGlyphCollection<'a>

Returns the collection of scalable glyph outlines.

If the font contains multiple outline sources, this method prioritizes glyf, CFF2 and CFF in that order. To select a specific outline source, use the OutlineGlyphCollection::with_format method.

source

fn color_glyphs(&self) -> ColorGlyphCollection<'a>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> MetadataProvider<'a> for FontRef<'a>