pub struct Strut {
pub above: f32,
pub below: f32,
}Expand description
Vertical extents around a baseline, in points: a face’s box when computed for one font and size, the paragraph’s strut when computed for the paragraph’s own style.
Fields§
§above: f32Distance from baseline to the top of the box.
below: f32Distance from baseline to the bottom of the box.
Implementations§
Source§impl Strut
impl Strut
Sourcepub fn from_metrics(
metrics: FontMetricsTable,
size: f32,
line_height: f32,
) -> Strut
pub fn from_metrics( metrics: FontMetricsTable, size: f32, line_height: f32, ) -> Strut
The box a face makes at size under a unitless line_height.
Sourcepub fn content(metrics: FontMetricsTable, size: f32) -> Strut
pub fn content(metrics: FontMetricsTable, size: f32) -> Strut
The content area a face makes at size: its ascent and its
descent alone. This is the box an inline element’s padding and
border are measured from, so what a chip encloses is the
letters rather than the space the line height opened around
them.
Trait Implementations§
impl Copy for Strut
impl StructuralPartialEq for Strut
Auto Trait Implementations§
impl Freeze for Strut
impl RefUnwindSafe for Strut
impl Send for Strut
impl Sync for Strut
impl Unpin for Strut
impl UnsafeUnpin for Strut
impl UnwindSafe for Strut
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,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.