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: Stretch
pub const EXTRA_CONDENSED: Stretch
pub const CONDENSED: Stretch
pub const SEMI_CONDENSED: Stretch
pub const NORMAL: Stretch
pub const SEMI_EXPANDED: Stretch
pub const EXPANDED: Stretch
pub const EXTRA_EXPANDED: Stretch
pub const ULTRA_EXPANDED: Stretch
Sourcepub fn from_percentage(percentage: f32) -> Stretch
pub fn from_percentage(percentage: f32) -> Stretch
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§fn from(s: Stretch) -> Attributes
fn from(s: Stretch) -> Attributes
Converts to this type from the input type.
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