pub struct TextMetrics {
pub width: f32,
pub height: f32,
pub ascent: f32,
pub descent: f32,
pub line_height: f32,
pub ink: Rect,
}Expand description
The size of text shaped with one font, from
Cx::measure_text, in logical pixels.
Fields§
§width: f32The advance of the widest line.
height: f32The line boxes: one line height per line.
ascent: f32How far the font rises above the baseline at this size.
descent: f32How far the font reaches below the baseline at this size, positive.
line_height: f32The height of one line, as a Text with this font has.
ink: RectThe tight box around the ink the glyphs draw, from the text’s
top-left, as Qt’s tightBoundingRect: x is negative when a glyph
hangs left of where the text starts, and the box can be wider than
width when ink reaches past the last advance, as a
Nerd Font icon in a monospace cell does. Read from the unhinted
outlines, unrounded; a color bitmap glyph, such as an emoji, gives
its pixels’ box. Empty text, or only blanks, gives an empty rect at
0, 0.