pub struct Width(f32);Expand description
How wide a design is relative to its normal width, typically from 0.5 to 2.0.
In variable fonts, this can be controlled with the wdth axis, which
expresses the width as a percentage.
Tuple Fields§
§0: f32Implementations§
Source§impl Width
impl Width
Sourcepub const ULTRA_CONDENSED: Self
pub const ULTRA_CONDENSED: Self
Width that is 50% of normal.
Sourcepub const EXTRA_CONDENSED: Self
pub const EXTRA_CONDENSED: Self
Width that is 62.5% of normal.
Sourcepub const SEMI_CONDENSED: Self
pub const SEMI_CONDENSED: Self
Width that is 87.5% of normal.
Sourcepub const SEMI_EXPANDED: Self
pub const SEMI_EXPANDED: Self
Width that is 112.5% of normal.
Sourcepub const EXTRA_EXPANDED: Self
pub const EXTRA_EXPANDED: Self
Width that is 150% of normal.
Sourcepub const ULTRA_EXPANDED: Self
pub const ULTRA_EXPANDED: Self
Width that is 200% of normal.
Sourcefn from_width_class(width_class: u16) -> Self
fn from_width_class(width_class: u16) -> Self
Creates a width from the usWidthClass field of the OS/2 table.
Sourcepub fn percentage(self) -> f32
pub fn percentage(self) -> f32
Returns the width as a percentage, which is the value used by the
wdth axis.
Trait Implementations§
impl Copy for Width
Source§impl PartialOrd for Width
impl PartialOrd for Width
impl StructuralPartialEq for Width
Auto Trait Implementations§
impl Freeze for Width
impl RefUnwindSafe for Width
impl Send for Width
impl Sync for Width
impl Unpin for Width
impl UnsafeUnpin for Width
impl UnwindSafe for Width
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