pub struct FontMetrics {
pub ascent: f64,
pub descent: f64,
pub cap_height: Option<f64>,
pub x_height: Option<f64>,
}Expand description
Vertical font metrics in /1000 em (1000 units-per-em), sourced from the
embedded font’s OS/2 / hhea tables via skrifa. ascent is positive (above
the baseline); descent is negative (below it). The whole struct is None
on a span when no embedded font binary exposes metrics (non-embedded
standard-14, CFF, Type1, Type3).
Fields§
§ascent: f64Ascent above the baseline, in /1000 em.
descent: f64Descent below the baseline (negative), in /1000 em.
cap_height: Option<f64>Cap height in /1000 em, when present in the font.
x_height: Option<f64>x-height in /1000 em, when present in the font.
Trait Implementations§
Source§impl Clone for FontMetrics
impl Clone for FontMetrics
Source§fn clone(&self) -> FontMetrics
fn clone(&self) -> FontMetrics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FontMetrics
Source§impl Debug for FontMetrics
impl Debug for FontMetrics
Source§impl Default for FontMetrics
impl Default for FontMetrics
Source§fn default() -> FontMetrics
fn default() -> FontMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for FontMetrics
impl PartialEq for FontMetrics
Source§fn eq(&self, other: &FontMetrics) -> bool
fn eq(&self, other: &FontMetrics) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FontMetrics
impl Serialize for FontMetrics
impl StructuralPartialEq for FontMetrics
Auto Trait Implementations§
impl Freeze for FontMetrics
impl RefUnwindSafe for FontMetrics
impl Send for FontMetrics
impl Sync for FontMetrics
impl Unpin for FontMetrics
impl UnsafeUnpin for FontMetrics
impl UnwindSafe for FontMetrics
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> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreimpl<T> ParallelSend for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().