pub trait MetadataProvider<'a>: TableProvider<'a> + Sized {
    // Provided 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> { ... }
}
Expand description

Interface for types that can provide font metadata.

Provided 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.

Implementors§

source§

impl<'a, T> MetadataProvider<'a> for Twhere T: TableProvider<'a>,

Blanket implementation of MetadataProvider for any type that implements TableProvider.