Struct speedy2d::font::FormattedGlyph
source · pub struct FormattedGlyph { /* private fields */ }
Expand description
Represents a glyph which has been laid out as part of a line of text.
Implementations§
source§impl FormattedGlyph
impl FormattedGlyph
sourcepub fn font_id(&self) -> FontId
pub fn font_id(&self) -> FontId
The identifier of the font which was used to render this glyph.
sourcepub fn user_index(&self) -> UserGlyphIndex
pub fn user_index(&self) -> UserGlyphIndex
The user_index
of the corresponding Codepoint
. This allows you to
identify which input Codepoint
corresponds to the output
FormattedGlyph
.
sourcepub fn position_x(&self) -> f32
pub fn position_x(&self) -> f32
The x
coordinate of this glyph, relative to the start of the line
sourcepub fn advance_width(&self) -> f32
pub fn advance_width(&self) -> f32
The character’s advance width. In the absence of any kerning information, this would represent the horizontal distance between the position of this character, and the position of the next character.
sourcepub fn pixel_bounding_box(&self) -> Option<Rect>
pub fn pixel_bounding_box(&self) -> Option<Rect>
The bounding box of this glyph in pixels. This encloses the total renderable area of the glyph.
Some glyphs, such as a space, might not render anything at all – in
this case, this function will return None
.
Trait Implementations§
source§impl Clone for FormattedGlyph
impl Clone for FormattedGlyph
source§fn clone(&self) -> FormattedGlyph
fn clone(&self) -> FormattedGlyph
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for FormattedGlyph
impl RefUnwindSafe for FormattedGlyph
impl Send for FormattedGlyph
impl Sync for FormattedGlyph
impl Unpin for FormattedGlyph
impl UnwindSafe for FormattedGlyph
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