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: NameId) -> LocalizedStrings<'a> ⓘ;
    fn glyph_names(&self) -> GlyphNames<'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>;
    fn bitmap_strikes(&self) -> BitmapStrikes<'a>;
}Expand description
Interface for types that can provide font metadata.
Required Methods§
Sourcefn attributes(&self) -> Attributes
 
fn attributes(&self) -> Attributes
Returns the primary attributes for font classification– stretch, style and weight.
Sourcefn axes(&self) -> AxisCollection<'a>
 
fn axes(&self) -> AxisCollection<'a>
Returns the collection of variation axes.
Sourcefn named_instances(&self) -> NamedInstanceCollection<'a>
 
fn named_instances(&self) -> NamedInstanceCollection<'a>
Returns the collection of named variation instances.
Sourcefn localized_strings(&self, id: NameId) -> LocalizedStrings<'a> ⓘ
 
fn localized_strings(&self, id: NameId) -> LocalizedStrings<'a> ⓘ
Returns an iterator over the collection of localized strings for the given informational string identifier.
Sourcefn glyph_names(&self) -> GlyphNames<'a>
 
fn glyph_names(&self) -> GlyphNames<'a>
Returns the mapping from glyph identifiers to names.
Sourcefn metrics(&self, size: Size, location: impl Into<LocationRef<'a>>) -> Metrics
 
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.
Sourcefn glyph_metrics(
    &self,
    size: Size,
    location: impl Into<LocationRef<'a>>,
) -> GlyphMetrics<'a>
 
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.
Sourcefn outline_glyphs(&self) -> OutlineGlyphCollection<'a>
 
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.
fn color_glyphs(&self) -> ColorGlyphCollection<'a>
Sourcefn bitmap_strikes(&self) -> BitmapStrikes<'a>
 
fn bitmap_strikes(&self) -> BitmapStrikes<'a>
Returns a collection of bitmap strikes.
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.