Trait fonts::FontTemplateRefMethods

source ·
pub trait FontTemplateRefMethods {
    // Required methods
    fn descriptor(&self) -> FontTemplateDescriptor;
    fn identifier(&self) -> FontIdentifier;
    fn matches_font_descriptor(
        &self,
        descriptor_to_match: &FontDescriptor,
    ) -> bool;
    fn descriptor_distance(&self, descriptor_to_match: &FontDescriptor) -> f32;
    fn char_in_unicode_range(&self, character: char) -> bool;
}

Required Methods§

source

fn descriptor(&self) -> FontTemplateDescriptor

Get the descriptor.

source

fn identifier(&self) -> FontIdentifier

Get the FontIdentifier for this template.

source

fn matches_font_descriptor(&self, descriptor_to_match: &FontDescriptor) -> bool

Returns true if the given descriptor matches the one in this FontTemplate.

source

fn descriptor_distance(&self, descriptor_to_match: &FontDescriptor) -> f32

Calculate the distance from this FontTemplates descriptor and return it or None if this is not a valid FontTemplate.

source

fn char_in_unicode_range(&self, character: char) -> bool

Whether or not this character is in the unicode ranges specified in this temlates @font-face definition, if any.

Implementors§