pub enum LineHeight {
Normal,
Relative(f32),
Absolute(f32),
}Expand description
How tall each line of a text is.
A bare number is a factor of the font size, as CSS’s line-height, iced
and Flutter all read it: line_height(1.5) is Relative(1.5). A height in
pixels is spelled Absolute.
§Examples
text("Notes").line_height(1.5);
text("Sign in").font_size(14.0).line_height(LineHeight::Absolute(20.0));Variants§
Normal
The font’s own line height: its ascent, descent and line gap, scaled to the size. Read from the face that draws the family at this weight — a fallback face where the family’s own font is not installed — and a fallback glyph later in the line does not change it.
Relative(f32)
A multiple of the font size. A bare number means this.
Absolute(f32)
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 From<f32> for LineHeight
impl From<f32> for LineHeight
Source§impl From<f64> for LineHeight
So a bare literal, which Rust types as f64 when nothing narrows it,
is a factor too.
impl From<f64> for LineHeight
So a bare literal, which Rust types as f64 when nothing narrows it,
is a factor too.
Source§impl IntoVal<LineHeight> for f32
impl IntoVal<LineHeight> for f32
fn into_val(self) -> LineHeight
Source§impl IntoVal<LineHeight> for f64
impl IntoVal<LineHeight> for f64
fn into_val(self) -> 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, M, S> Animate<T, M> for Swhere
T: Clone + 'static,
S: IntoSignal<T, M>,
impl<T, M, S> Animate<T, M> for Swhere
T: Clone + 'static,
S: IntoSignal<T, M>,
Source§fn transition(self, transition: impl Into<TransitionConfig>) -> Animated<T>
fn transition(self, transition: impl Into<TransitionConfig>) -> Animated<T>
Ease to each new value this holds, instead of jumping to it. Read more
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.