Trait style::servo::media_queries::FontMetricsProvider

source ·
pub trait FontMetricsProvider: Debug + Sync {
    // Required methods
    fn query_font_metrics(
        &self,
        vertical: bool,
        font: &Font,
        base_size: CSSPixelLength,
        in_media_query: bool,
        retrieve_math_scales: bool,
    ) -> FontMetrics;
    fn base_size_for_generic(&self, generic: GenericFontFamily) -> Length;
}
Expand description

A trait used to query font metrics in clients of Stylo. This is used by Device to query font metrics in a way that is specific to the client using Stylo.

Required Methods§

source

fn query_font_metrics( &self, vertical: bool, font: &Font, base_size: CSSPixelLength, in_media_query: bool, retrieve_math_scales: bool, ) -> FontMetrics

Query the font metrics for the given font and the given base font size.

source

fn base_size_for_generic(&self, generic: GenericFontFamily) -> Length

Gets the base size given a generic font family.

Implementors§