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: GlyphId
The glyph ID in the font.
byte_idx: ByteIndex
Position 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: String
The text from the original string that corresponds to that glyph.
dx: i32
The glyph offset in font units.
dy: i32
The glyph offset in font units.
width: i32
The 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