pub struct GlyphMetrics {
pub bearing_x: f32,
pub bearing_y: f32,
pub advance_x: f32,
pub advance_y: f32,
pub width: f32,
pub height: f32,
}Expand description
Per-glyph metrics usable for layout without rasterising.
All values are in pixels (already scaled by the rendering font size). The
bearings follow the usual font conventions: bearing_x is the horizontal
distance from the pen origin to the left edge of the glyph bounding box,
and bearing_y is the vertical distance from the baseline to the top of
the bounding box (positive = above the baseline).
Fields§
§bearing_x: f32Horizontal distance from the pen origin to the left edge (signed).
bearing_y: f32Vertical distance from the baseline to the top edge (positive = up).
advance_x: f32Horizontal advance in pixels.
advance_y: f32Vertical advance in pixels (usually 0.0 for horizontal text).
width: f32Glyph bounding-box width in pixels.
height: f32Glyph bounding-box height in pixels.
Trait Implementations§
Source§impl Clone for GlyphMetrics
impl Clone for GlyphMetrics
Source§fn clone(&self) -> GlyphMetrics
fn clone(&self) -> GlyphMetrics
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 moreSource§impl Debug for GlyphMetrics
impl Debug for GlyphMetrics
Source§impl Default for GlyphMetrics
impl Default for GlyphMetrics
Source§impl PartialEq for GlyphMetrics
impl PartialEq for GlyphMetrics
Source§fn eq(&self, other: &GlyphMetrics) -> bool
fn eq(&self, other: &GlyphMetrics) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for GlyphMetrics
impl StructuralPartialEq for GlyphMetrics
Auto Trait Implementations§
impl Freeze for GlyphMetrics
impl RefUnwindSafe for GlyphMetrics
impl Send for GlyphMetrics
impl Sync for GlyphMetrics
impl Unpin for GlyphMetrics
impl UnsafeUnpin for GlyphMetrics
impl UnwindSafe for GlyphMetrics
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