pub struct TextMetrics {
pub width: f64,
pub height: f64,
pub ascent: f64,
pub descent: f64,
pub line_height: f64,
}Expand description
The measured metrics of a text run.
All values are in CSS pixels, for the font the run was measured with.
Fields§
§width: f64The advance width of the run.
height: f64The height of the run’s bounding box, from the top of the ascent to the bottom of the descent.
ascent: f64The distance from the baseline up to the top of the tallest glyph.
descent: f64The distance from the baseline down to the bottom of the lowest glyph.
line_height: f64The distance between two consecutive baselines.
Trait Implementations§
Source§impl Clone for TextMetrics
impl Clone for TextMetrics
impl Copy for TextMetrics
Source§impl Debug for TextMetrics
impl Debug for TextMetrics
Source§impl Default for TextMetrics
impl Default for TextMetrics
Source§impl PartialEq for TextMetrics
impl PartialEq 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 UnsafeUnpin 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