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§
source§impl 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§
source§impl<'de> Deserialize<'de> for Glyph
impl<'de> Deserialize<'de> for Glyph
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more