pub(crate) struct Glyph {
pub(crate) id: GlyphId,
pub(crate) byte_idx: ByteIndex,
pub(crate) cluster_len: usize,
pub(crate) text: String,
pub(crate) dx: i32,
pub(crate) dy: i32,
pub(crate) width: i32,
pub(crate) font: Arc<ResolvedFont>,
}Expand description
A glyph.
Basically, a glyph ID and it’s metrics.
Fields§
§id: GlyphIdThe glyph ID in the font.
byte_idx: ByteIndexPosition in bytes in the original string.
We use it to match a glyph with a character in the text chunk and therefore with the style.
cluster_len: usize§text: StringThe text from the original string that corresponds to that glyph.
dx: i32The glyph offset in font units.
dy: i32The glyph offset in font units.
width: i32The glyph width / X-advance in font units.
font: Arc<ResolvedFont>Reference to the source font.
Each glyph can have it’s own source font.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Glyph
impl RefUnwindSafe for Glyph
impl Send for Glyph
impl Sync for Glyph
impl Unpin for Glyph
impl UnwindSafe for Glyph
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