fonts::font_template

Trait FontMatchDistanceMethod

Source
trait FontMatchDistanceMethod: Sized {
    // Required methods
    fn match_distance(&self, range: &(Self, Self)) -> 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: &(Self, Self)) -> 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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FontMatchDistanceMethod for T

Source§

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

Source§

fn to_float(&self) -> f32

Source§

impl FontMatchDistanceMethod for T

Source§

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

Source§

fn to_float(&self) -> f32

Source§

impl FontMatchDistanceMethod for FontWeight

Source§

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

Source§

fn to_float(&self) -> f32

Implementors§