pub struct FontTemplate {
pub identifier: FontIdentifier,
pub descriptor: FontTemplateDescriptor,
pub font_face_rule: Option<Descriptors>,
}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§font_face_rule: Option<Descriptors>If this font is a web font, this is a reference to the @font-face rule that
created it.
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,
font_face_rule: Option<FontFaceRuleDescriptors>,
) -> FontTemplate
pub fn new( identifier: FontIdentifier, descriptor: FontTemplateDescriptor, font_face_rule: Option<FontFaceRuleDescriptors>, ) -> FontTemplate
Create a new FontTemplate.
Sourcepub fn new_for_local_web_font(
local_template: FontTemplateRef,
css_font_template_descriptors: &CSSFontFaceDescriptors,
font_face_rule: Option<FontFaceRuleDescriptors>,
) -> Result<FontTemplate, &'static str>
pub fn new_for_local_web_font( local_template: FontTemplateRef, css_font_template_descriptors: &CSSFontFaceDescriptors, font_face_rule: Option<FontFaceRuleDescriptors>, ) -> 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
Sourcepub fn compute_variations(
&self,
descriptor: &FontDescriptor,
) -> Vec<FontVariation>
pub fn compute_variations( &self, descriptor: &FontDescriptor, ) -> Vec<FontVariation>
pub fn is_defined_by_font_face_rule( &self, rule: &FontFaceRuleDescriptors, ) -> bool
Trait Implementations§
Source§impl Clone for FontTemplate
impl Clone for FontTemplate
Source§fn clone(&self) -> FontTemplate
fn clone(&self) -> FontTemplate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl Freeze for FontTemplate
impl RefUnwindSafe for FontTemplate
impl Send for FontTemplate
impl Sync for FontTemplate
impl Unpin for FontTemplate
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert