Struct cosmic_text::LayoutGlyph
source · pub struct LayoutGlyph {}
Expand description
A laid out glyph
Fields§
§start: usize
Start index of cluster in original line
end: usize
End index of cluster in original line
font_size: f32
Font size of the glyph
font_id: ID
Font id of the glyph
glyph_id: u16
Font id of the glyph
x: f32
X offset of hitbox
y: f32
Y offset of hitbox
w: f32
Width of hitbox
level: Level
Unicode BiDi embedding level, character is left-to-right if level
is divisible by 2
x_offset: f32
X offset in line
If you are dealing with physical coordinates, use Self::physical
to obtain a
PhysicalGlyph
for rendering.
This offset is useful when you are dealing with logical units and you do not care or cannot guarantee pixel grid alignment. For instance, when you want to use the glyphs for vectorial text, apply linear transformations to the layout, etc.
y_offset: f32
Y offset in line
If you are dealing with physical coordinates, use Self::physical
to obtain a
PhysicalGlyph
for rendering.
This offset is useful when you are dealing with logical units and you do not care or cannot guarantee pixel grid alignment. For instance, when you want to use the glyphs for vectorial text, apply linear transformations to the layout, etc.
color_opt: Option<Color>
Optional color override
metadata: usize
Metadata from Attrs