#[repr(C)]pub struct FontStretch(pub FontStretchFixedPoint);
Expand description
A value for the font-stretch property per:
https://drafts.csswg.org/css-fonts-4/#propdef-font-stretch
cbindgen:derive-lt cbindgen:derive-lte cbindgen:derive-gt cbindgen:derive-gte
Tuple Fields§
§0: FontStretchFixedPoint
Implementations§
source§impl FontStretch
impl FontStretch
sourcepub const FRACTION_BITS: u16 = 6u16
pub const FRACTION_BITS: u16 = 6u16
The fraction bits, as an easy-to-access-constant.
sourcepub const ULTRA_CONDENSED: FontStretch = _
pub const ULTRA_CONDENSED: FontStretch = _
The ultra-condensed
keyword.
sourcepub const EXTRA_CONDENSED: FontStretch = _
pub const EXTRA_CONDENSED: FontStretch = _
The extra-condensed
keyword.
sourcepub const CONDENSED: FontStretch = _
pub const CONDENSED: FontStretch = _
The condensed
keyword.
sourcepub const SEMI_CONDENSED: FontStretch = _
pub const SEMI_CONDENSED: FontStretch = _
The semi-condensed
keyword.
sourcepub const NORMAL: FontStretch = _
pub const NORMAL: FontStretch = _
The normal
keyword.
sourcepub const SEMI_EXPANDED: FontStretch = _
pub const SEMI_EXPANDED: FontStretch = _
The semi-expanded
keyword.
sourcepub const EXPANDED: FontStretch = _
pub const EXPANDED: FontStretch = _
The expanded
keyword.
sourcepub const EXTRA_EXPANDED: FontStretch = _
pub const EXTRA_EXPANDED: FontStretch = _
The extra-expanded
keyword.
sourcepub const ULTRA_EXPANDED: FontStretch = _
pub const ULTRA_EXPANDED: FontStretch = _
The ultra-expanded
keyword.
sourcepub fn to_percentage(&self) -> Percentage
pub fn to_percentage(&self) -> Percentage
Converts to a computed percentage.
sourcepub fn from_percentage(p: f32) -> Self
pub fn from_percentage(p: f32) -> Self
Converts from a computed percentage value.
sourcepub fn from_keyword(kw: FontStretchKeyword) -> Self
pub fn from_keyword(kw: FontStretchKeyword) -> Self
Returns a relevant stretch value from a keyword. https://drafts.csswg.org/css-fonts-4/#font-stretch-prop
sourcepub fn as_keyword(&self) -> Option<FontStretchKeyword>
pub fn as_keyword(&self) -> Option<FontStretchKeyword>
Returns the stretch keyword if we map to one of the relevant values.
Trait Implementations§
source§impl Clone for FontStretch
impl Clone for FontStretch
source§fn clone(&self) -> FontStretch
fn clone(&self) -> FontStretch
Returns a copy 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 ComputeSquaredDistance for FontStretch
impl ComputeSquaredDistance for FontStretch
source§fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
Computes the squared distance between two animatable values.
source§impl Debug for FontStretch
impl Debug for FontStretch
source§impl<'de> Deserialize<'de> for FontStretch
impl<'de> Deserialize<'de> for FontStretch
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for FontStretch
impl Hash for FontStretch
source§impl MallocSizeOf for FontStretch
impl MallocSizeOf for FontStretch
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 FontStretch
impl PartialEq for FontStretch
source§impl PartialOrd for FontStretch
impl PartialOrd for FontStretch
source§impl Serialize for FontStretch
impl Serialize for FontStretch
source§impl ToAnimatedValue for FontStretch
impl ToAnimatedValue for FontStretch
source§type AnimatedValue = Percentage
type AnimatedValue = Percentage
The type of the animated value.
source§fn to_animated_value(self, _: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, _: &Context<'_>) -> Self::AnimatedValue
Converts this value to an animated value.
source§fn from_animated_value(animated: Self::AnimatedValue) -> Self
fn from_animated_value(animated: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
source§impl ToCss for FontStretch
impl ToCss for FontStretch
source§impl ToResolvedValue for FontStretch
impl ToResolvedValue for FontStretch
source§type ResolvedValue = FontStretch
type ResolvedValue = FontStretch
The resolved value type we’re going to be converted to.
source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.
impl Copy for FontStretch
impl StructuralPartialEq for FontStretch
Auto Trait Implementations§
impl Freeze for FontStretch
impl RefUnwindSafe for FontStretch
impl Send for FontStretch
impl Sync for FontStretch
impl Unpin for FontStretch
impl UnwindSafe for FontStretch
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
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>
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