pub struct TextBounds {
pub layout: CanvasRect,
pub content: CanvasRect,
pub ink: Option<CanvasRect>,
pub line_count: u32,
pub baselines: Baselines,
pub font_size: f32,
pub truncated: bool,
pub overflow: bool,
}Expand description
Where a text lies, as fractions of the canvas from (0, 0) top-left to (1, 1)
bottom-right. For a text generator this is on its picture, before the clip’s transform
and effects; for a caption it is on the canvas.
Fields§
§layout: CanvasRectThe box the style’s anchor and position place: the wrapping width wide, every line’s em box tall, plus whole pixels of outline and background padding.
content: CanvasRectThe span of the lines’ advances, as tall as the layout and with the same decorations. It moves only with the advances, not with glyph ink.
ink: Option<CanvasRect>What the text draws (glyphs, outline, background boxes), as
alpha2_text::TextMeasure::ink bounds it, within the texture’s sampling spread.
None when the text draws nothing.
line_count: u32Number of laid-out lines.
baselines: BaselinesThe first and last lines’ alphabetic baselines.
font_size: f32The font size drawn after any font_size_fit, a fraction of the canvas’s shorter side.
truncated: boolWhether the style’s line_clamp discarded lines.
overflow: boolWhether the drawn text still splits a word or is taller than max_height.