pub struct Glyph<Length> {
pub advance: Length,
pub offset_x: Length,
pub offset_y: Length,
pub glyph_id: Option<NonZeroU16>,
pub text_byte_offset: usize,
}
Expand description
This struct describes a glyph from shaping to rendering. This includes the relative shaping offsets, advance (in abstract lengths) and platform specific glyph data.
Fields§
§advance: Length
§offset_x: Length
§offset_y: Length
§glyph_id: Option<NonZeroU16>
Glyph IDs are font specific identifiers. In TrueType fonts zero indicates the missing glyph, which is mapped to an Option here.
text_byte_offset: usize
The byte offset back in the original (Rust) string to the character that “produced” this glyph. When one character produces multiple glyphs (for example decomposed ligature), then all glyphs have the same offset.
Trait Implementations§
Auto Trait Implementations§
impl<Length> Freeze for Glyph<Length>where
Length: Freeze,
impl<Length> RefUnwindSafe for Glyph<Length>where
Length: RefUnwindSafe,
impl<Length> Send for Glyph<Length>where
Length: Send,
impl<Length> Sync for Glyph<Length>where
Length: Sync,
impl<Length> Unpin for Glyph<Length>where
Length: Unpin,
impl<Length> UnwindSafe for Glyph<Length>where
Length: UnwindSafe,
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