Trait style::font_metrics::FontMetricsProvider [] [src]

pub trait FontMetricsProvider: Debug {
    fn get_size(&self, font_name: &Atom, font_family: u8) -> Au;
fn create_from(context: &SharedStyleContext) -> Self
    where
        Self: Sized
; fn query(
        &self,
        _font: &Font,
        _font_size: Au,
        _wm: WritingMode,
        _in_media_query: bool,
        _device: &Device
    ) -> FontMetricsQueryResult { ... } }

A trait used to represent something capable of providing us font metrics.

Required Methods

Get default size of a given language and generic family

Construct from a shared style context

Provided Methods

Obtain the metrics for given font family.

TODO: We could make this take the full list, I guess, and save a few virtual calls in the case we are repeatedly unable to find font metrics? That is not too common in practice though.

Implementors