pub struct FontTemplateDescriptor {
pub weight: (FontWeight, FontWeight),
pub stretch: (FontStretch, FontStretch),
pub style: (FontStyle, FontStyle),
pub unicode_range: Option<Vec<RangeInclusive<u32>>>,
}
Expand description
Describes how to select a font from a given family. This is very basic at the moment and needs to be expanded or refactored when we support more of the font styling parameters.
NB: If you change this, you will need to update style::properties::compute_font_hash()
.
Fields§
§weight: (FontWeight, FontWeight)
§stretch: (FontStretch, FontStretch)
§style: (FontStyle, FontStyle)
§unicode_range: Option<Vec<RangeInclusive<u32>>>
Implementations§
Source§impl FontTemplateDescriptor
impl FontTemplateDescriptor
pub fn new( weight: FontWeight, stretch: FontStretch, style: FontStyle, ) -> FontTemplateDescriptor
pub fn is_variation_font(&self) -> bool
pub fn override_values_with_css_font_template_descriptors( &mut self, css_font_template_descriptors: &CSSFontFaceDescriptors, )
Trait Implementations§
Source§impl Clone for FontTemplateDescriptor
impl Clone for FontTemplateDescriptor
Source§fn clone(&self) -> FontTemplateDescriptor
fn clone(&self) -> FontTemplateDescriptor
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 FontTemplateDescriptor
impl Debug for FontTemplateDescriptor
Source§impl Default for FontTemplateDescriptor
impl Default for FontTemplateDescriptor
Source§fn default() -> FontTemplateDescriptor
fn default() -> FontTemplateDescriptor
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FontTemplateDescriptor
impl<'de> Deserialize<'de> for FontTemplateDescriptor
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FontTemplateDescriptor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FontTemplateDescriptor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for FontTemplateDescriptor
impl Hash for FontTemplateDescriptor
Source§impl MallocSizeOf for FontTemplateDescriptor
impl MallocSizeOf for FontTemplateDescriptor
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.
Source§impl PartialEq for FontTemplateDescriptor
impl PartialEq for FontTemplateDescriptor
Source§impl Serialize for FontTemplateDescriptor
impl Serialize for FontTemplateDescriptor
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for FontTemplateDescriptor
FontTemplateDescriptor contains floats, which are not Eq because of NaN. However, we know they will never be NaN, so we can manually implement Eq.
impl StructuralPartialEq for FontTemplateDescriptor
Auto Trait Implementations§
impl Freeze for FontTemplateDescriptor
impl RefUnwindSafe for FontTemplateDescriptor
impl Send for FontTemplateDescriptor
impl Sync for FontTemplateDescriptor
impl Unpin for FontTemplateDescriptor
impl UnwindSafe for FontTemplateDescriptor
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.