Struct style::properties::generated::style_structs::Font
source · pub struct Font {
pub font_family: T,
pub font_style: T,
pub font_variant_caps: T,
pub font_weight: T,
pub font_size: T,
pub font_stretch: T,
pub font_language_override: T,
pub _x_lang: T,
pub line_height: T,
pub hash: u64,
}
Expand description
The Font style struct.
Fields§
§font_family: T
The font-family computed value.
font_style: T
The font-style computed value.
font_variant_caps: T
The font-variant-caps computed value.
font_weight: T
The font-weight computed value.
font_size: T
The font-size computed value.
font_stretch: T
The font-stretch computed value.
font_language_override: T
The font-language-override computed value.
_x_lang: T
The -x-lang computed value.
line_height: T
The line-height computed value.
hash: u64
The font hash, used for font caching.
Implementations§
source§impl Font
impl Font
sourcepub fn set_font_family(&mut self, v: T)
pub fn set_font_family(&mut self, v: T)
Set font-family.
sourcepub fn copy_font_family_from(&mut self, other: &Self)
pub fn copy_font_family_from(&mut self, other: &Self)
Set font-family from other struct.
sourcepub fn reset_font_family(&mut self, other: &Self)
pub fn reset_font_family(&mut self, other: &Self)
Reset font-family from the initial struct.
sourcepub fn clone_font_family(&self) -> T
pub fn clone_font_family(&self) -> T
Get the computed value for font-family.
sourcepub fn set_font_style(&mut self, v: T)
pub fn set_font_style(&mut self, v: T)
Set font-style.
sourcepub fn copy_font_style_from(&mut self, other: &Self)
pub fn copy_font_style_from(&mut self, other: &Self)
Set font-style from other struct.
sourcepub fn reset_font_style(&mut self, other: &Self)
pub fn reset_font_style(&mut self, other: &Self)
Reset font-style from the initial struct.
sourcepub fn clone_font_style(&self) -> T
pub fn clone_font_style(&self) -> T
Get the computed value for font-style.
sourcepub fn set_font_variant_caps(&mut self, v: T)
pub fn set_font_variant_caps(&mut self, v: T)
Set font-variant-caps.
sourcepub fn copy_font_variant_caps_from(&mut self, other: &Self)
pub fn copy_font_variant_caps_from(&mut self, other: &Self)
Set font-variant-caps from other struct.
sourcepub fn reset_font_variant_caps(&mut self, other: &Self)
pub fn reset_font_variant_caps(&mut self, other: &Self)
Reset font-variant-caps from the initial struct.
sourcepub fn clone_font_variant_caps(&self) -> T
pub fn clone_font_variant_caps(&self) -> T
Get the computed value for font-variant-caps.
sourcepub fn set_font_weight(&mut self, v: T)
pub fn set_font_weight(&mut self, v: T)
Set font-weight.
sourcepub fn copy_font_weight_from(&mut self, other: &Self)
pub fn copy_font_weight_from(&mut self, other: &Self)
Set font-weight from other struct.
sourcepub fn reset_font_weight(&mut self, other: &Self)
pub fn reset_font_weight(&mut self, other: &Self)
Reset font-weight from the initial struct.
sourcepub fn clone_font_weight(&self) -> T
pub fn clone_font_weight(&self) -> T
Get the computed value for font-weight.
sourcepub fn set_font_size(&mut self, v: T)
pub fn set_font_size(&mut self, v: T)
Set font-size.
sourcepub fn copy_font_size_from(&mut self, other: &Self)
pub fn copy_font_size_from(&mut self, other: &Self)
Set font-size from other struct.
sourcepub fn reset_font_size(&mut self, other: &Self)
pub fn reset_font_size(&mut self, other: &Self)
Reset font-size from the initial struct.
sourcepub fn clone_font_size(&self) -> T
pub fn clone_font_size(&self) -> T
Get the computed value for font-size.
sourcepub fn set_font_stretch(&mut self, v: T)
pub fn set_font_stretch(&mut self, v: T)
Set font-stretch.
sourcepub fn copy_font_stretch_from(&mut self, other: &Self)
pub fn copy_font_stretch_from(&mut self, other: &Self)
Set font-stretch from other struct.
sourcepub fn reset_font_stretch(&mut self, other: &Self)
pub fn reset_font_stretch(&mut self, other: &Self)
Reset font-stretch from the initial struct.
sourcepub fn clone_font_stretch(&self) -> T
pub fn clone_font_stretch(&self) -> T
Get the computed value for font-stretch.
sourcepub fn set_font_language_override(&mut self, v: T)
pub fn set_font_language_override(&mut self, v: T)
Set font-language-override.
sourcepub fn copy_font_language_override_from(&mut self, other: &Self)
pub fn copy_font_language_override_from(&mut self, other: &Self)
Set font-language-override from other struct.
sourcepub fn reset_font_language_override(&mut self, other: &Self)
pub fn reset_font_language_override(&mut self, other: &Self)
Reset font-language-override from the initial struct.
sourcepub fn clone_font_language_override(&self) -> T
pub fn clone_font_language_override(&self) -> T
Get the computed value for font-language-override.
sourcepub fn set__x_lang(&mut self, v: T)
pub fn set__x_lang(&mut self, v: T)
Set -x-lang.
sourcepub fn copy__x_lang_from(&mut self, other: &Self)
pub fn copy__x_lang_from(&mut self, other: &Self)
Set -x-lang from other struct.
sourcepub fn reset__x_lang(&mut self, other: &Self)
pub fn reset__x_lang(&mut self, other: &Self)
Reset -x-lang from the initial struct.
sourcepub fn clone__x_lang(&self) -> T
pub fn clone__x_lang(&self) -> T
Get the computed value for -x-lang.
sourcepub fn set_line_height(&mut self, v: T)
pub fn set_line_height(&mut self, v: T)
Set line-height.
sourcepub fn copy_line_height_from(&mut self, other: &Self)
pub fn copy_line_height_from(&mut self, other: &Self)
Set line-height from other struct.
sourcepub fn reset_line_height(&mut self, other: &Self)
pub fn reset_line_height(&mut self, other: &Self)
Reset line-height from the initial struct.
sourcepub fn clone_line_height(&self) -> T
pub fn clone_line_height(&self) -> T
Get the computed value for line-height.
sourcepub fn compute_font_hash(&mut self)
pub fn compute_font_hash(&mut self)
Computes a font hash in order to be able to cache fonts effectively in GFX and layout.
sourcepub fn initial_values() -> Self
pub fn initial_values() -> Self
Create a new Font with the initial values of all members.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Font
impl<'de> Deserialize<'de> for Font
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 Font
impl MallocSizeOf for Font
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl Freeze for Font
impl RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnwindSafe for Font
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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