pub struct GlyphRun {
pub font: FontBlob,
pub size: f32,
pub color: Color,
pub glyphs: Vec<PositionedGlyph>,
pub ink_bounds: Rect,
}Expand description
A shaped run of glyphs that all use one font, size and color.
Glyph positions are in the run’s paint coordinates, which leave out the
scroll offsets of enclosing views (see crate::widget::Widget::paint),
with each glyph’s x and y at its baseline origin. A renderer
rasterizes each glyph separately and blits it in its run’s color, so
nothing else about the text, such as clusters or line breaking, travels
with the run.
Fields§
§font: FontBlobThe font the glyph identifiers refer to.
size: f32The font size in logical pixels.
color: ColorThe straight-alpha sRGB color the glyphs paint with.
glyphs: Vec<PositionedGlyph>The glyphs of the run, in paint order.
ink_bounds: RectThe rectangle in the run’s paint coordinates that covers the ink of every glyph, plus one logical pixel on every side for anti-aliasing.
A renderer may rely on it as the area the run can change: ink outside it is not guaranteed to be drawn.