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
Source§fn clone(&self) -> LineHeight
fn clone(&self) -> LineHeight
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LineHeight
Source§impl Debug for LineHeight
impl Debug for LineHeight
Source§impl Default for LineHeight
impl Default for LineHeight
Source§fn default() -> LineHeight
fn default() -> LineHeight
Matches parley’s own default: the font’s natural metrics-relative line height.
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.