pub struct DeviceMetrics {
pub ascent: f32,
pub descent: f32,
pub line_gap: f32,
pub line_height: f32,
}Expand description
Font metrics resolved to device pixels.
Fields§
§ascent: f32Pixels above the baseline to the ascender.
descent: f32Pixels below the baseline to the descender, as a positive number.
line_gap: f32Pixels of extra leading between lines.
line_height: f32ascent + descent + line_gap: the recommended distance between
consecutive baselines.
Implementations§
Source§impl DeviceMetrics
impl DeviceMetrics
Sourcepub fn from_font(m: &FontMetrics, scale: f32) -> Self
pub fn from_font(m: &FontMetrics, scale: f32) -> Self
Scale a FontMetrics by scale (pixels per font unit).
Trait Implementations§
Source§impl Clone for DeviceMetrics
impl Clone for DeviceMetrics
impl Copy for DeviceMetrics
Source§impl Debug for DeviceMetrics
impl Debug for DeviceMetrics
Source§impl PartialEq for DeviceMetrics
impl PartialEq for DeviceMetrics
impl StructuralPartialEq for DeviceMetrics
Auto Trait Implementations§
impl Freeze for DeviceMetrics
impl RefUnwindSafe for DeviceMetrics
impl Send for DeviceMetrics
impl Sync for DeviceMetrics
impl Unpin for DeviceMetrics
impl UnsafeUnpin for DeviceMetrics
impl UnwindSafe for DeviceMetrics
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