Struct style::properties::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 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.
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 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 inherit_font_size_from(
&mut self,
parent: &Self,
_: Option<NonNegativeLength>,
_: &Device
)
pub fn inherit_font_size_from(
&mut self,
parent: &Self,
_: Option<NonNegativeLength>,
_: &Device
)
(Servo does not handle MathML, so this just calls copy_font_size_from)
sourcepub fn apply_font_size(
&mut self,
v: T,
_: &Self,
_: &Device
) -> Option<NonNegativeLength>
pub fn apply_font_size(
&mut self,
v: T,
_: &Self,
_: &Device
) -> Option<NonNegativeLength>
(Servo does not handle MathML, so this just calls set_font_size)
sourcepub fn apply_unconstrained_font_size(&mut self, _: NonNegativeLength)
pub fn apply_unconstrained_font_size(&mut self, _: NonNegativeLength)
(Servo does not handle MathML, so this does nothing)