Skip to main content

FontMatchDistanceMethod

Trait FontMatchDistanceMethod 

Source
trait FontMatchDistanceMethod<T>: Sized {
    // Required methods
    fn match_distance(&self, range: &T) -> f32;
    fn to_float(&self) -> f32;
}
Expand description

A trait for implementing the CSS font matching algorithm against various font features. See https://drafts.csswg.org/css-fonts/#font-matching-algorithm.

This implementation is ported from Gecko at: https://searchfox.org/mozilla-central/rev/0529464f0d2981347ef581f7521ace8b7af7f7ac/gfx/thebes/gfxFontUtils.h#1217.

Required Methods§

Source

fn match_distance(&self, range: &T) -> f32

Source

fn to_float(&self) -> f32

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FontMatchDistanceMethod<ComputedFontStyleRange> for T

Source§

impl FontMatchDistanceMethod<ComputedFontWeightRange> for FontWeight

Source§

impl FontMatchDistanceMethod<ComputedFontWidthRange> for T

Implementors§