pub struct Stretch(/* private fields */);
Expand description
Visual width of a font– a relative change from the normal aspect ratio.
Implementations§
Source§impl Stretch
impl Stretch
pub const ULTRA_CONDENSED: Self
pub const EXTRA_CONDENSED: Self
pub const CONDENSED: Self
pub const SEMI_CONDENSED: Self
pub const NORMAL: Self
pub const SEMI_EXPANDED: Self
pub const EXPANDED: Self
pub const EXTRA_EXPANDED: Self
pub const ULTRA_EXPANDED: Self
Sourcepub fn from_percentage(percentage: f32) -> Self
pub fn from_percentage(percentage: f32) -> Self
Creates a stretch attribute from a percentage. The value will be clamped at half percentage increments between 50% and 200%, inclusive.
Sourcepub fn to_percentage(self) -> f32
pub fn to_percentage(self) -> f32
Converts the stretch value to a percentage.
Sourcepub fn is_condensed(self) -> bool
pub fn is_condensed(self) -> bool
Returns true if the stretch is condensed (less than normal).
Sourcepub fn is_expanded(self) -> bool
pub fn is_expanded(self) -> bool
Returns true if the stretch is expanded (greater than normal).
Trait Implementations§
Source§impl From<Stretch> for Attributes
impl From<Stretch> for Attributes
Source§impl Ord for Stretch
impl Ord for Stretch
Source§impl PartialOrd for Stretch
impl PartialOrd for Stretch
impl Copy for Stretch
impl Eq 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