pub struct Stretch(f32);
Expand description
Visual width of a font– a relative change from the normal aspect ratio, typically in the range 0.5 to 2.0.
In variable fonts, this can be controlled with the wdth
axis.
Tuple Fields§
§0: f32
Implementations§
Source§impl Stretch
impl Stretch
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.
Source§impl Stretch
impl Stretch
Sourcefn from_width_class(width_class: u16) -> Self
fn from_width_class(width_class: u16) -> Self
Creates a new stretch attribute from the usWidthClass field of the OS/2 table.
Sourcepub const fn ratio(self) -> f32
pub const fn ratio(self) -> f32
Returns the stretch attribute as a ratio.
This is a linear scaling factor with 1.0 being “normal” width.
Sourcepub fn percentage(self) -> f32
pub fn percentage(self) -> f32
Returns the stretch attribute as a percentage value.
This is generally the value associated with the wdth
axis.
Trait Implementations§
Source§impl PartialOrd for Stretch
impl PartialOrd for Stretch
impl Copy for Stretch
impl StructuralPartialEq for Stretch
Auto Trait Implementations§
impl Freeze for Stretch
impl RefUnwindSafe for Stretch
impl Send for Stretch
impl Sync for Stretch
impl Unpin for Stretch
impl UnwindSafe for Stretch
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