pub struct TextBounds {
pub layout: CanvasRect,
pub content: CanvasRect,
pub ink: Option<CanvasRect>,
pub line_count: u32,
}Expand description
Where a text lies, as fractions of the canvas, (0, 0) top-left to
(1, 1) bottom-right, as its style’s position is: on the picture a text
generator draws, before its clip’s transform and effects, and on the
canvas for a caption. measure_text measures it.
Fields§
§layout: CanvasRectThe box the style’s anchor and position place: the wrapping width wide, every line’s em box tall, and the whole pixels of outline and background padding around that.
content: CanvasRectThe lines’ advances: from the start of the line that starts farthest left to the end of the one that ends farthest right, as tall as the layout, with the same decorations around it. It moves only as the advances do, not as glyphs with more or less ink are typed.
ink: Option<CanvasRect>What the text draws: its glyphs, their outline, and the background’s
boxes, as alpha2_text::TextMeasure::ink bounds them at the measured
size. Every pixel the text gives any alpha there meets it, give or
take the pixel sampling the texture spreads it by. None when the text
draws nothing.
line_count: u32Number of laid-out lines.