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

source

pub fn set_font_family(&mut self, v: T)

Set font-family.

source

pub fn copy_font_family_from(&mut self, other: &Self)

Set font-family from other struct.

source

pub fn reset_font_family(&mut self, other: &Self)

Reset font-family from the initial struct.

source

pub fn clone_font_family(&self) -> T

Get the computed value for font-family.

source

pub fn set_font_style(&mut self, v: T)

Set font-style.

source

pub fn copy_font_style_from(&mut self, other: &Self)

Set font-style from other struct.

source

pub fn reset_font_style(&mut self, other: &Self)

Reset font-style from the initial struct.

source

pub fn clone_font_style(&self) -> T

Get the computed value for font-style.

source

pub fn set_font_variant_caps(&mut self, v: T)

Set font-variant-caps.

source

pub fn copy_font_variant_caps_from(&mut self, other: &Self)

Set font-variant-caps from other struct.

source

pub fn reset_font_variant_caps(&mut self, other: &Self)

Reset font-variant-caps from the initial struct.

source

pub fn clone_font_variant_caps(&self) -> T

Get the computed value for font-variant-caps.

source

pub fn set_font_weight(&mut self, v: T)

Set font-weight.

source

pub fn copy_font_weight_from(&mut self, other: &Self)

Set font-weight from other struct.

source

pub fn reset_font_weight(&mut self, other: &Self)

Reset font-weight from the initial struct.

source

pub fn clone_font_weight(&self) -> T

Get the computed value for font-weight.

source

pub fn set_font_size(&mut self, v: T)

Set font-size.

source

pub fn copy_font_size_from(&mut self, other: &Self)

Set font-size from other struct.

source

pub fn reset_font_size(&mut self, other: &Self)

Reset font-size from the initial struct.

source

pub fn clone_font_size(&self) -> T

Get the computed value for font-size.

source

pub fn set_font_stretch(&mut self, v: T)

Set font-stretch.

source

pub fn copy_font_stretch_from(&mut self, other: &Self)

Set font-stretch from other struct.

source

pub fn reset_font_stretch(&mut self, other: &Self)

Reset font-stretch from the initial struct.

source

pub fn clone_font_stretch(&self) -> T

Get the computed value for font-stretch.

source

pub fn set_font_language_override(&mut self, v: T)

Set font-language-override.

source

pub fn copy_font_language_override_from(&mut self, other: &Self)

Set font-language-override from other struct.

source

pub fn reset_font_language_override(&mut self, other: &Self)

Reset font-language-override from the initial struct.

source

pub fn clone_font_language_override(&self) -> T

Get the computed value for font-language-override.

source

pub fn set__x_lang(&mut self, v: T)

Set -x-lang.

source

pub fn copy__x_lang_from(&mut self, other: &Self)

Set -x-lang from other struct.

source

pub fn reset__x_lang(&mut self, other: &Self)

Reset -x-lang from the initial struct.

source

pub fn clone__x_lang(&self) -> T

Get the computed value for -x-lang.

source

pub fn set_line_height(&mut self, v: T)

Set line-height.

source

pub fn copy_line_height_from(&mut self, other: &Self)

Set line-height from other struct.

source

pub fn reset_line_height(&mut self, other: &Self)

Reset line-height from the initial struct.

source

pub fn clone_line_height(&self) -> T

Get the computed value for line-height.

source

pub fn compute_font_hash(&mut self)

Computes a font hash in order to be able to cache fonts effectively in GFX and layout.

source

pub fn initial_values() -> Self

Create a new Font with the initial values of all members.

Trait Implementations§

source§

impl Clone for Font

source§

fn clone(&self) -> Font

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Font

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Font

source§

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 Font

source§

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 Font

source§

fn eq(&self, other: &Font) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Font

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> MaybeBoxed<Box<T>> for T

source§

fn maybe_boxed(self) -> Box<T>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T