pub enum LineHeight {
MetricsRelative(f32),
FontSizeRelative(f32),
Absolute(f32),
}Expand description
Line height: how much vertical space each line of text occupies.
Mirrors parley’s LineHeight semantics (see parley::LineHeight)
without leaking the parley type. M3’s type scale specifies line heights
in absolute logical pixels (LineHeight::Absolute);
LineHeight::FontSizeRelative is the documented M3-friendly choice when
a consistent, font-independent ratio is preferred instead.
Variants§
MetricsRelative(f32)
A multiple of the font’s own metrics-derived line height (ascender +
descender + line gap/leading). 1.0 is the font’s natural line
height.
FontSizeRelative(f32)
A multiple of the font size — CSS’s unitless line-height. Useful
for consistent line heights across platforms/fonts when using
system-defined generic families.
Absolute(f32)
An absolute line height in logical pixels.
Trait Implementations§
Source§impl Clone for LineHeight
impl Clone for LineHeight
impl Copy for LineHeight
Source§impl Debug for LineHeight
impl Debug for LineHeight
Source§impl Default for LineHeight
impl Default for LineHeight
Source§impl PartialEq for LineHeight
impl PartialEq for LineHeight
impl StructuralPartialEq for LineHeight
Auto Trait Implementations§
impl Freeze for LineHeight
impl RefUnwindSafe for LineHeight
impl Send for LineHeight
impl Sync for LineHeight
impl Unpin for LineHeight
impl UnsafeUnpin for LineHeight
impl UnwindSafe for LineHeight
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