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§
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: StringId) -> LocalizedStrings<'a> ⓘ
fn localized_strings(&self, id: StringId) -> LocalizedStrings<'a> ⓘ
Returns an iterator over the collection of localized strings for the given informational string identifier.
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.