pub struct TextMetrics {
pub width: f32,
pub ascent: f32,
pub descent: f32,
pub line_height: f32,
}Expand description
How much room a run of text takes.
Fields§
§width: f32The advance width of the whole run.
ascent: f32Distance from the baseline up to the top of the line box.
descent: f32Distance from the baseline down to the bottom of the line box.
line_height: f32The height of the line box. At least ascent + descent, more if the
style asked for a taller line.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextMetrics
Source§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
Source§fn eq(&self, other: &TextMetrics) -> bool
fn eq(&self, other: &TextMetrics) -> bool
Tests for
self and other values to be equal, and is used by ==.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