Trait fonts::font_template::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§
sourcefn descriptor(&self) -> FontTemplateDescriptor
fn descriptor(&self) -> FontTemplateDescriptor
Get the descriptor.
sourcefn identifier(&self) -> FontIdentifier
fn identifier(&self) -> FontIdentifier
Get the FontIdentifier
for this template.
sourcefn matches_font_descriptor(&self, descriptor_to_match: &FontDescriptor) -> bool
fn matches_font_descriptor(&self, descriptor_to_match: &FontDescriptor) -> bool
Returns true if the given descriptor matches the one in this FontTemplate
.
sourcefn descriptor_distance(&self, descriptor_to_match: &FontDescriptor) -> f32
fn descriptor_distance(&self, descriptor_to_match: &FontDescriptor) -> f32
Calculate the distance from this FontTemplate
s descriptor and return it
or None if this is not a valid FontTemplate
.
sourcefn char_in_unicode_range(&self, character: char) -> bool
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.