pub struct ShapedGlyph {
pub gid: u16,
pub x_advance: f32,
pub y_advance: f32,
pub x_offset: f32,
pub y_offset: f32,
pub cluster: u32,
pub is_whitespace: bool,
pub unsafe_to_break: bool,
}Expand description
A glyph produced by the shaper.
Fields§
§gid: u16Glyph ID in the font.
x_advance: f32Horizontal advance in pixels (scaled by font size).
y_advance: f32Vertical advance (usually 0.0 for LTR text).
x_offset: f32Horizontal offset from the cursor position.
y_offset: f32Vertical offset from the baseline.
cluster: u32Index into the source string (UTF-8 byte offset of cluster start).
is_whitespace: booltrue if this glyph represents whitespace (space, tab, newline).
Layout engines use this to distinguish trimmable trailing whitespace and to compute expandable gaps for justified text.
unsafe_to_break: booltrue if breaking a line before this glyph is unsafe because the
glyph is part of a multi-glyph cluster (e.g. a ligature or a mark
attached to a base glyph). Mirrors HarfBuzz’s unsafe_to_break flag.
Trait Implementations§
Source§impl Clone for ShapedGlyph
impl Clone for ShapedGlyph
Source§fn clone(&self) -> ShapedGlyph
fn clone(&self) -> ShapedGlyph
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 ShapedGlyph
impl Debug for ShapedGlyph
Auto Trait Implementations§
impl Freeze for ShapedGlyph
impl RefUnwindSafe for ShapedGlyph
impl Send for ShapedGlyph
impl Sync for ShapedGlyph
impl Unpin for ShapedGlyph
impl UnsafeUnpin for ShapedGlyph
impl UnwindSafe for ShapedGlyph
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