pub struct LayoutFontMetrics {
pub ascent: f32,
pub descent: f32,
pub line_gap: f32,
pub units_per_em: u16,
}Expand description
Layout-specific font metrics extracted from FontMetrics Contains only the metrics needed for text layout and rendering
Fields§
§ascent: f32§descent: f32§line_gap: f32§units_per_em: u16Implementations§
Source§impl LayoutFontMetrics
impl LayoutFontMetrics
pub fn baseline_scaled(&self, font_size: f32) -> f32
Sourcepub fn from_font_metrics(metrics: &FontMetrics) -> Self
pub fn from_font_metrics(metrics: &FontMetrics) -> Self
Convert from full FontMetrics to layout-specific metrics
Trait Implementations§
Source§impl Clone for LayoutFontMetrics
impl Clone for LayoutFontMetrics
Source§fn clone(&self) -> LayoutFontMetrics
fn clone(&self) -> LayoutFontMetrics
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 moreAuto Trait Implementations§
impl Freeze for LayoutFontMetrics
impl RefUnwindSafe for LayoutFontMetrics
impl Send for LayoutFontMetrics
impl Sync for LayoutFontMetrics
impl Unpin for LayoutFontMetrics
impl UnwindSafe for LayoutFontMetrics
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more