pub struct TextMeasure {
pub box_width: u32,
pub box_height: u32,
pub decoration_margin: u32,
pub content: [f32; 4],
pub ink: Option<[f32; 4]>,
pub line_count: u32,
}Expand description
Where a request’s text lies, without drawing it
(TextRasterizer::measure): rectangles as [left, top, right, bottom]
in pixels from the layout box’s top-left corner, y down. The texture
TextRasterizer::rasterize draws for the request holds that corner at
(TextTexture::layout_x, TextTexture::layout_y).
Fields§
§box_width: u32The layout box’s width in whole pixels: the width the request wraps at, else its widest line, rounded up.
box_height: u32The layout box’s height in whole pixels: every line’s em box, rounded up.
decoration_margin: u32§content: [f32; 4]From the start of the line that starts farthest left to the end of the one that ends farthest right, the box’s height, grown by the decoration margin as the box is. It moves only as the lines’ advances do, not as glyphs with more or less ink are typed.
ink: Option<[f32; 4]>What the text draws: each glyph’s outline (its curves, not their
control points) or color form, the outline’s band around them, and
the background’s boxes. Every pixel the raster gives any alpha meets
it, and it reaches at most a pixel past them, or past a COLR glyph’s
outlines and clip boxes, which may hold a little more than it paints.
None when the text draws nothing.
line_count: u32Number of laid-out lines.