use super::{
charmap::Charmap,
metrics::{GlyphMetrics, Metrics},
strings::{LocalizedStrings, StringId},
};
use crate::{NormalizedCoord, NormalizedCoords, Size};
pub trait MetadataProvider<'a>: raw::TableProvider<'a> + Sized {
fn localized_strings(&self, id: StringId) -> LocalizedStrings<'a> {
LocalizedStrings::new(self, id)
}
fn metrics(&self, size: Size, coords: NormalizedCoords<'a>) -> Metrics {
Metrics::new(self, size, coords)
}
fn glyph_metrics(&self, size: Size, coords: NormalizedCoords<'a>) -> GlyphMetrics<'a> {
GlyphMetrics::new(self, size, coords)
}
fn charmap(&self) -> Charmap<'a> {
Charmap::new(self)
}
}
impl<'a, T> MetadataProvider<'a> for T where T: raw::TableProvider<'a> {}