pub struct TextMetrics {
pub width: f32,
pub height: f32,
pub line_count: usize,
pub line_height: f32,
pub ascent: f32,
pub descent: f32,
pub cap_height: f32,
pub x_height: f32,
pub unsupported: usize,
}Expand description
Measured size of styled text in logical units.
Fields§
§width: f32Widest line from the first glyph’s left edge to the last glyph’s right edge (no trailing spacing). Shadows and outlines add one font pixel.
height: f32From the first line’s top to the last line’s descender bottom.
line_count: usizeLines separated by \n (a trailing \r is ignored); empty text has none.
line_height: f32Baseline-to-baseline distance.
ascent: f32Top of a line to its baseline (includes room for capital accents).
descent: f32Baseline to the bottom of descenders.
cap_height: f32§x_height: f32§unsupported: usizeCharacters drawn with the ? fallback.
Trait Implementations§
Source§impl Clone for TextMetrics
impl Clone for TextMetrics
Source§fn clone(&self) -> TextMetrics
fn clone(&self) -> TextMetrics
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 moreSource§impl Debug for TextMetrics
impl Debug for TextMetrics
Source§impl Default for TextMetrics
impl Default for TextMetrics
Source§fn default() -> TextMetrics
fn default() -> TextMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for TextMetrics
impl PartialEq for TextMetrics
impl Copy for TextMetrics
impl StructuralPartialEq for TextMetrics
Auto Trait Implementations§
impl Freeze for TextMetrics
impl RefUnwindSafe for TextMetrics
impl Send for TextMetrics
impl Sync for TextMetrics
impl Unpin for TextMetrics
impl UnwindSafe for TextMetrics
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