Trait fonts::FontTemplateRefMethods

source ·
pub trait FontTemplateRefMethods {
    // Required methods
    fn data(&self) -> Arc<Vec<u8>>;
    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 data(&self) -> Arc<Vec<u8>>

Returns a reference to the data in this font. This may be a hugely expensive operation (depending on the platform) which performs synchronous disk I/O and should never be done lightly.

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§