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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)