pub enum LineHeightValue {
Normal(f32),
Pt(f32),
}Expand description
Specifies how line height is computed for text layout.
§Example
use floem_renderer::text::{Attrs, LineHeightValue};
// 1.5x the font size (e.g. 24px for a 16px font).
let attrs = Attrs::new().line_height(LineHeightValue::Normal(1.5));
// Fixed 20-point line height regardless of font size.
let attrs = Attrs::new().line_height(LineHeightValue::Pt(20.0));Variants§
Normal(f32)
A multiplier of the font size (e.g. 1.0 means line height equals font size).
Pt(f32)
An absolute line height in points.
Implementations§
Trait Implementations§
Source§impl Clone for LineHeightValue
impl Clone for LineHeightValue
Source§fn clone(&self) -> LineHeightValue
fn clone(&self) -> LineHeightValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LineHeightValue
impl Debug for LineHeightValue
Source§impl From<f32> for LineHeightValue
impl From<f32> for LineHeightValue
Source§impl From<f64> for LineHeightValue
impl From<f64> for LineHeightValue
Source§impl From<i32> for LineHeightValue
impl From<i32> for LineHeightValue
Source§impl PartialEq for LineHeightValue
impl PartialEq for LineHeightValue
impl Copy for LineHeightValue
impl StructuralPartialEq for LineHeightValue
Auto Trait Implementations§
impl Freeze for LineHeightValue
impl RefUnwindSafe for LineHeightValue
impl Send for LineHeightValue
impl Sync for LineHeightValue
impl Unpin for LineHeightValue
impl UnsafeUnpin for LineHeightValue
impl UnwindSafe for LineHeightValue
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.