#[repr(C)]pub struct FontWidth(pub FontWidthFixedPoint);Expand description
A value for the font-width property per:
https://drafts.csswg.org/css-fonts-4/#propdef-font-width
(Note that this property was formerly named font-stretch.)
cbindgen:derive-lt cbindgen:derive-lte cbindgen:derive-gt cbindgen:derive-gte
Tuple Fields§
§0: FontWidthFixedPointImplementations§
Source§impl FontWidth
impl FontWidth
Sourcepub const FRACTION_BITS: u16 = FONT_WIDTH_FRACTION_BITS
pub const FRACTION_BITS: u16 = FONT_WIDTH_FRACTION_BITS
The fraction bits, as an easy-to-access-constant.
Sourcepub const ULTRA_CONDENSED: FontWidth
pub const ULTRA_CONDENSED: FontWidth
The ultra-condensed keyword.
Sourcepub const EXTRA_CONDENSED: FontWidth
pub const EXTRA_CONDENSED: FontWidth
The extra-condensed keyword.
Sourcepub const SEMI_CONDENSED: FontWidth
pub const SEMI_CONDENSED: FontWidth
The semi-condensed keyword.
Sourcepub const SEMI_EXPANDED: FontWidth
pub const SEMI_EXPANDED: FontWidth
The semi-expanded keyword.
Sourcepub const EXTRA_EXPANDED: FontWidth
pub const EXTRA_EXPANDED: FontWidth
The extra-expanded keyword.
Sourcepub const ULTRA_EXPANDED: FontWidth
pub const ULTRA_EXPANDED: FontWidth
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: FontWidthKeyword) -> Self
pub fn from_keyword(kw: FontWidthKeyword) -> Self
Returns a relevant width value from a keyword. https://drafts.csswg.org/css-fonts-4/#font-width-prop
Sourcepub fn as_keyword(&self) -> Option<FontWidthKeyword>
pub fn as_keyword(&self) -> Option<FontWidthKeyword>
Returns the width keyword if we map to one of the relevant values.
Trait Implementations§
Source§impl ComputeSquaredDistance for FontWidth
impl ComputeSquaredDistance for FontWidth
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<'de> Deserialize<'de> for FontWidth
impl<'de> Deserialize<'de> for FontWidth
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 MallocSizeOf for FontWidth
impl MallocSizeOf for FontWidth
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 PartialOrd for FontWidth
impl PartialOrd for FontWidth
Source§impl ToAnimatedValue for FontWidth
impl ToAnimatedValue for FontWidth
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 FontWidth
impl ToCss for FontWidth
Source§fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
Serialize
self in CSS syntax, writing to dest.Source§fn to_css_string(&self) -> String
fn to_css_string(&self) -> String
Serialize
self in CSS syntax and return a string. Read moreSource§fn to_css_cssstring(&self) -> String
fn to_css_cssstring(&self) -> String
Serialize
self in CSS syntax and return a CssString. Read moreSource§impl ToResolvedValue for FontWidth
impl ToResolvedValue for FontWidth
Source§type ResolvedValue = FontWidth
type ResolvedValue = FontWidth
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.
Source§impl ToTyped for FontWidth
impl ToTyped for FontWidth
Source§fn to_typed_value(&self) -> Option<TypedValue>
fn to_typed_value(&self) -> Option<TypedValue>
Source§fn to_numeric_value(&self) -> Option<NumericValue>
fn to_numeric_value(&self) -> Option<NumericValue>
Source§fn to_typed_value_list(&self) -> Option<TypedValueList>
fn to_typed_value_list(&self) -> Option<TypedValueList>
impl Copy for FontWidth
impl StructuralPartialEq for FontWidth
Auto Trait Implementations§
impl Freeze for FontWidth
impl RefUnwindSafe for FontWidth
impl Send for FontWidth
impl Sync for FontWidth
impl Unpin for FontWidth
impl UnsafeUnpin for FontWidth
impl UnwindSafe for FontWidth
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§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