Struct style::font_metrics::FontMetrics
source · pub struct FontMetrics {
pub x_height: Option<Length>,
pub zero_advance_measure: Option<Length>,
pub cap_height: Option<Length>,
pub ic_width: Option<Length>,
pub ascent: Length,
pub script_percent_scale_down: Option<f32>,
pub script_script_percent_scale_down: Option<f32>,
}
Expand description
Represents the font metrics that style needs from a font to compute the
value of certain CSS units like ex
.
Fields§
§x_height: Option<Length>
The x-height of the font.
zero_advance_measure: Option<Length>
The zero advance. This is usually writing mode dependent
cap_height: Option<Length>
The cap-height of the font.
ic_width: Option<Length>
The ideographic-width of the font.
ascent: Length
The ascent of the font (a value is always available for this).
script_percent_scale_down: Option<f32>
Script scale down factor for math-depth 1. https://w3c.github.io/mathml-core/#dfn-scriptpercentscaledown
script_script_percent_scale_down: Option<f32>
Script scale down factor for math-depth 2. https://w3c.github.io/mathml-core/#dfn-scriptscriptpercentscaledown
Trait Implementations§
source§impl Clone for FontMetrics
impl Clone for FontMetrics
source§fn clone(&self) -> FontMetrics
fn clone(&self) -> FontMetrics
Returns a copy 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 FontMetrics
impl Debug for FontMetrics
source§impl Default for FontMetrics
impl Default for FontMetrics
source§impl PartialEq for FontMetrics
impl PartialEq 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 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert