pub struct FontTemplate {
    pub identifier: FontIdentifier,
    pub descriptor: FontTemplateDescriptor,
    pub stylesheet: Option<DocumentStyleSheet>,
}Expand description
This describes all the information needed to create font instance handles. It contains a unique FontTemplateData structure that is platform specific.
Fields§
§identifier: FontIdentifier§descriptor: FontTemplateDescriptor§stylesheet: Option<DocumentStyleSheet>If this font is a web font, this is a reference to the stylesheet that created it. This will be used to remove this font from caches, when the stylesheet is removed.
This is not serialized, as it’s only useful in the [super::FontContext]
that it is created in.
Implementations§
Source§impl FontTemplate
Holds all of the template information for a font that
is common, regardless of the number of instances of
this font handle per thread.
 
impl FontTemplate
Holds all of the template information for a font that is common, regardless of the number of instances of this font handle per thread.
Sourcepub fn new(
    identifier: FontIdentifier,
    descriptor: FontTemplateDescriptor,
    stylesheet: Option<DocumentStyleSheet>,
) -> FontTemplate
 
pub fn new( identifier: FontIdentifier, descriptor: FontTemplateDescriptor, stylesheet: Option<DocumentStyleSheet>, ) -> FontTemplate
Create a new FontTemplate.
Sourcepub fn new_for_local_web_font(
    local_template: FontTemplateRef,
    css_font_template_descriptors: &CSSFontFaceDescriptors,
    stylesheet: Option<DocumentStyleSheet>,
) -> Result<FontTemplate, &'static str>
 
pub fn new_for_local_web_font( local_template: FontTemplateRef, css_font_template_descriptors: &CSSFontFaceDescriptors, stylesheet: Option<DocumentStyleSheet>, ) -> Result<FontTemplate, &'static str>
Create a new FontTemplate for a @font-family with a local(...) src. This takes in
the template of the local font and creates a new one that reflects the properties specified
by @font-family in the stylesheet.
pub fn identifier(&self) -> &FontIdentifier
Trait Implementations§
Source§impl Clone for FontTemplate
 
impl Clone for FontTemplate
Source§fn clone(&self) -> FontTemplate
 
fn clone(&self) -> FontTemplate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FontTemplate
 
impl Debug for FontTemplate
Source§impl<'de> Deserialize<'de> for FontTemplate
 
impl<'de> Deserialize<'de> for FontTemplate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Source§impl MallocSizeOf for FontTemplate
 
impl MallocSizeOf for FontTemplate
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
 
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl Freeze for FontTemplate
impl !RefUnwindSafe for FontTemplate
impl Send for FontTemplate
impl Sync for FontTemplate
impl Unpin for FontTemplate
impl !UnwindSafe for FontTemplate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more