pub struct Glyph {
pub chr: char,
pub pos: Pos2,
pub size: Vec2,
pub uv_rect: UvRect,
pub section_index: u32,
}
Fields
chr: char
The character this glyph represents.
pos: Pos2
Relative to the galley position.
Logical position: pos.y is the same for all chars of the same TextFormat
.
size: Vec2
Advance width and font row height.
uv_rect: UvRect
Position of the glyph in the font texture, in texels.
section_index: u32
Index into LayoutJob::sections
. Decides color etc.
Implementations
sourceimpl Glyph
impl Glyph
pub fn max_x(&self) -> f32
sourcepub fn logical_rect(&self) -> Rect
pub fn logical_rect(&self) -> Rect
Same y range for all characters with the same TextFormat
.
Trait Implementations
impl Copy for Glyph
impl StructuralPartialEq for Glyph
Auto Trait Implementations
impl RefUnwindSafe for Glyph
impl Send for Glyph
impl Sync for Glyph
impl Unpin for Glyph
impl UnwindSafe for Glyph
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more