pub struct Font {Show 13 fields
pub _x_lang: XLang,
pub font_family: FontFamily,
pub font_language_override: FontLanguageOverride,
pub font_size: FontSize,
pub font_stretch: FontStretch,
pub font_style: FontStyle,
pub font_synthesis_weight: FontSynthesis,
pub font_variation_settings: FontSettings<VariationValue<f32>>,
pub font_weight: FontWeight,
pub line_height: GenericLineHeight<NonNegative<f32>, NonNegative<CSSPixelLength>>,
pub font_variant_caps: T,
pub font_optical_sizing: T,
pub hash: u64,
}Expand description
The Font style struct.
Fields§
§_x_lang: XLangThe -x-lang computed value.
font_family: FontFamilyThe font-family computed value.
font_language_override: FontLanguageOverrideThe font-language-override computed value.
font_size: FontSizeThe font-size computed value.
font_stretch: FontStretchThe font-stretch computed value.
font_style: FontStyleThe font-style computed value.
font_synthesis_weight: FontSynthesisThe font-synthesis-weight computed value.
font_variation_settings: FontSettings<VariationValue<f32>>The font-variation-settings computed value.
font_weight: FontWeightThe font-weight computed value.
line_height: GenericLineHeight<NonNegative<f32>, NonNegative<CSSPixelLength>>The line-height computed value.
font_variant_caps: TThe font-variant-caps computed value.
font_optical_sizing: TThe font-optical-sizing computed value.
hash: u64The font hash, used for font caching.
Implementations§
Source§impl Font
impl Font
Sourcepub fn set__x_lang(&mut self, v: XLang)
pub fn set__x_lang(&mut self, v: XLang)
Set -x-lang.
Sourcepub fn copy__x_lang_from(&mut self, other: &Font)
pub fn copy__x_lang_from(&mut self, other: &Font)
Set -x-lang from other struct.
Sourcepub fn reset__x_lang(&mut self, other: &Font)
pub fn reset__x_lang(&mut self, other: &Font)
Reset -x-lang from the initial struct.
Sourcepub fn clone__x_lang(&self) -> XLang
pub fn clone__x_lang(&self) -> XLang
Get the computed value for -x-lang.
Sourcepub fn _x_lang_equals(&self, other: &Font) -> bool
pub fn _x_lang_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for -x-lang.
Sourcepub fn set_font_family(&mut self, v: FontFamily)
pub fn set_font_family(&mut self, v: FontFamily)
Set font-family.
Sourcepub fn copy_font_family_from(&mut self, other: &Font)
pub fn copy_font_family_from(&mut self, other: &Font)
Set font-family from other struct.
Sourcepub fn reset_font_family(&mut self, other: &Font)
pub fn reset_font_family(&mut self, other: &Font)
Reset font-family from the initial struct.
Sourcepub fn clone_font_family(&self) -> FontFamily
pub fn clone_font_family(&self) -> FontFamily
Get the computed value for font-family.
Sourcepub fn font_family_equals(&self, other: &Font) -> bool
pub fn font_family_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-family.
Sourcepub fn set_font_language_override(&mut self, v: FontLanguageOverride)
pub fn set_font_language_override(&mut self, v: FontLanguageOverride)
Set font-language-override.
Sourcepub fn copy_font_language_override_from(&mut self, other: &Font)
pub fn copy_font_language_override_from(&mut self, other: &Font)
Set font-language-override from other struct.
Sourcepub fn reset_font_language_override(&mut self, other: &Font)
pub fn reset_font_language_override(&mut self, other: &Font)
Reset font-language-override from the initial struct.
Sourcepub fn clone_font_language_override(&self) -> FontLanguageOverride
pub fn clone_font_language_override(&self) -> FontLanguageOverride
Get the computed value for font-language-override.
Sourcepub fn font_language_override_equals(&self, other: &Font) -> bool
pub fn font_language_override_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-language-override.
Sourcepub fn set_font_size(&mut self, v: FontSize)
pub fn set_font_size(&mut self, v: FontSize)
Set font-size.
Sourcepub fn copy_font_size_from(&mut self, other: &Font)
pub fn copy_font_size_from(&mut self, other: &Font)
Set font-size from other struct.
Sourcepub fn reset_font_size(&mut self, other: &Font)
pub fn reset_font_size(&mut self, other: &Font)
Reset font-size from the initial struct.
Sourcepub fn clone_font_size(&self) -> FontSize
pub fn clone_font_size(&self) -> FontSize
Get the computed value for font-size.
Sourcepub fn font_size_equals(&self, other: &Font) -> bool
pub fn font_size_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-size.
Sourcepub fn set_font_stretch(&mut self, v: FontStretch)
pub fn set_font_stretch(&mut self, v: FontStretch)
Set font-stretch.
Sourcepub fn copy_font_stretch_from(&mut self, other: &Font)
pub fn copy_font_stretch_from(&mut self, other: &Font)
Set font-stretch from other struct.
Sourcepub fn reset_font_stretch(&mut self, other: &Font)
pub fn reset_font_stretch(&mut self, other: &Font)
Reset font-stretch from the initial struct.
Sourcepub fn clone_font_stretch(&self) -> FontStretch
pub fn clone_font_stretch(&self) -> FontStretch
Get the computed value for font-stretch.
Sourcepub fn font_stretch_equals(&self, other: &Font) -> bool
pub fn font_stretch_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-stretch.
Sourcepub fn set_font_style(&mut self, v: FontStyle)
pub fn set_font_style(&mut self, v: FontStyle)
Set font-style.
Sourcepub fn copy_font_style_from(&mut self, other: &Font)
pub fn copy_font_style_from(&mut self, other: &Font)
Set font-style from other struct.
Sourcepub fn reset_font_style(&mut self, other: &Font)
pub fn reset_font_style(&mut self, other: &Font)
Reset font-style from the initial struct.
Sourcepub fn clone_font_style(&self) -> FontStyle
pub fn clone_font_style(&self) -> FontStyle
Get the computed value for font-style.
Sourcepub fn font_style_equals(&self, other: &Font) -> bool
pub fn font_style_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-style.
Sourcepub fn set_font_synthesis_weight(&mut self, v: FontSynthesis)
pub fn set_font_synthesis_weight(&mut self, v: FontSynthesis)
Set font-synthesis-weight.
Sourcepub fn copy_font_synthesis_weight_from(&mut self, other: &Font)
pub fn copy_font_synthesis_weight_from(&mut self, other: &Font)
Set font-synthesis-weight from other struct.
Sourcepub fn reset_font_synthesis_weight(&mut self, other: &Font)
pub fn reset_font_synthesis_weight(&mut self, other: &Font)
Reset font-synthesis-weight from the initial struct.
Sourcepub fn clone_font_synthesis_weight(&self) -> FontSynthesis
pub fn clone_font_synthesis_weight(&self) -> FontSynthesis
Get the computed value for font-synthesis-weight.
Sourcepub fn font_synthesis_weight_equals(&self, other: &Font) -> bool
pub fn font_synthesis_weight_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-synthesis-weight.
Sourcepub fn set_font_variation_settings(
&mut self,
v: FontSettings<VariationValue<f32>>,
)
pub fn set_font_variation_settings( &mut self, v: FontSettings<VariationValue<f32>>, )
Set font-variation-settings.
Sourcepub fn copy_font_variation_settings_from(&mut self, other: &Font)
pub fn copy_font_variation_settings_from(&mut self, other: &Font)
Set font-variation-settings from other struct.
Sourcepub fn reset_font_variation_settings(&mut self, other: &Font)
pub fn reset_font_variation_settings(&mut self, other: &Font)
Reset font-variation-settings from the initial struct.
Sourcepub fn clone_font_variation_settings(&self) -> FontSettings<VariationValue<f32>>
pub fn clone_font_variation_settings(&self) -> FontSettings<VariationValue<f32>>
Get the computed value for font-variation-settings.
Sourcepub fn font_variation_settings_equals(&self, other: &Font) -> bool
pub fn font_variation_settings_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-variation-settings.
Sourcepub fn set_font_weight(&mut self, v: FontWeight)
pub fn set_font_weight(&mut self, v: FontWeight)
Set font-weight.
Sourcepub fn copy_font_weight_from(&mut self, other: &Font)
pub fn copy_font_weight_from(&mut self, other: &Font)
Set font-weight from other struct.
Sourcepub fn reset_font_weight(&mut self, other: &Font)
pub fn reset_font_weight(&mut self, other: &Font)
Reset font-weight from the initial struct.
Sourcepub fn clone_font_weight(&self) -> FontWeight
pub fn clone_font_weight(&self) -> FontWeight
Get the computed value for font-weight.
Sourcepub fn font_weight_equals(&self, other: &Font) -> bool
pub fn font_weight_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-weight.
Sourcepub fn set_line_height(
&mut self,
v: GenericLineHeight<NonNegative<f32>, NonNegative<CSSPixelLength>>,
)
pub fn set_line_height( &mut self, v: GenericLineHeight<NonNegative<f32>, NonNegative<CSSPixelLength>>, )
Set line-height.
Sourcepub fn copy_line_height_from(&mut self, other: &Font)
pub fn copy_line_height_from(&mut self, other: &Font)
Set line-height from other struct.
Sourcepub fn reset_line_height(&mut self, other: &Font)
pub fn reset_line_height(&mut self, other: &Font)
Reset line-height from the initial struct.
Sourcepub fn clone_line_height(
&self,
) -> GenericLineHeight<NonNegative<f32>, NonNegative<CSSPixelLength>>
pub fn clone_line_height( &self, ) -> GenericLineHeight<NonNegative<f32>, NonNegative<CSSPixelLength>>
Get the computed value for line-height.
Sourcepub fn line_height_equals(&self, other: &Font) -> bool
pub fn line_height_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for line-height.
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: &Font)
pub fn copy_font_variant_caps_from(&mut self, other: &Font)
Set font-variant-caps from other struct.
Sourcepub fn reset_font_variant_caps(&mut self, other: &Font)
pub fn reset_font_variant_caps(&mut self, other: &Font)
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 font_variant_caps_equals(&self, other: &Font) -> bool
pub fn font_variant_caps_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-variant-caps.
Sourcepub fn set_font_optical_sizing(&mut self, v: T)
pub fn set_font_optical_sizing(&mut self, v: T)
Set font-optical-sizing.
Sourcepub fn copy_font_optical_sizing_from(&mut self, other: &Font)
pub fn copy_font_optical_sizing_from(&mut self, other: &Font)
Set font-optical-sizing from other struct.
Sourcepub fn reset_font_optical_sizing(&mut self, other: &Font)
pub fn reset_font_optical_sizing(&mut self, other: &Font)
Reset font-optical-sizing from the initial struct.
Sourcepub fn clone_font_optical_sizing(&self) -> T
pub fn clone_font_optical_sizing(&self) -> T
Get the computed value for font-optical-sizing.
Sourcepub fn font_optical_sizing_equals(&self, other: &Font) -> bool
pub fn font_optical_sizing_equals(&self, other: &Font) -> bool
Whether self and other have the same computed value for font-optical-sizing.
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() -> Font
pub fn initial_values() -> Font
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<Font, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Font, <__D as Deserializer<'de>>::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
Source§impl Serialize for Font
impl Serialize for Font
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,
Auto Trait Implementations§
impl Freeze for Font
impl RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnsafeUnpin 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§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