Trait fonts::font_template::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

Object Safety§

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§