FontMetrics
struct · ferroui-base · v0.5.0
struct FontMetrics
The font metrics is holding information about a font's ascent, descent, etc. in design em units.
Members
design_em_heightis_fixed_pitchascentdescentline_gapunderline_positionunderline_thicknessstrikethrough_positionstrikethrough_thicknesscap_heightline_spacing
design_em_height
design_em_height: u16
The font design units per em.
is_fixed_pitch
is_fixed_pitch: bool
Whether all glyphs have the same advance.
ascent
ascent: i32
The recommended distance above the baseline in design em size.
descent
descent: i32
The recommended distance under the baseline in design em size.
line_gap
line_gap: i32
The recommended additional space between two lines of text in design em size.
underline_position
underline_position: i32
A value that indicates the distance of the underline from the baseline in design em size.
underline_thickness
underline_thickness: i32
A value that indicates the thickness of the underline in design em size.
strikethrough_position
strikethrough_position: i32
A value that indicates the distance of the strikethrough from the baseline in design em size.
strikethrough_thickness
strikethrough_thickness: i32
A value that indicates the thickness of the strikethrough in design em size.
cap_height
cap_height: i32
The height of the capital letters above the baseline in design em size (positive). A
FerroUI addition (docs/porting/DEVIATIONS.md, Fonts): the sCapHeight of the OS/2
table, or the top of the glyph of "H" for a font whose table has none.
line_spacing
fn line_spacing(self: &Self) -> i32
The line spacing in the design em size (descent - ascent + line_gap).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneCopyDebugDefaultStructuralPartialEqPartialEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.