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,
pub first_baseline: f32,
pub last_baseline: f32,
pub truncated: bool,
}Expand description
Text geometry from TextRasterizer::measure. Rectangles are [left, top, right, bottom]
in pixels from the layout box’s top-left, which sits at (TextTexture::layout_x,
TextTexture::layout_y) in the rasterized texture.
Fields§
§box_width: u32The wrap width, else the widest line, rounded up.
box_height: u32All lines’ em boxes, rounded up.
decoration_margin: u32§content: [f32; 4]Horizontal extent of the line advances by the box height, grown by the decoration
margin. Unlike ink, it does not depend on glyph shapes.
ink: Option<[f32; 4]>Bounds of everything drawn (glyphs, strokes, background), at most a pixel loose (more for
COLR clip boxes). None when nothing is drawn.
line_count: u32Number of laid-out lines.
first_baseline: f32First alphabetic baseline, in pixels from the layout box’s top.
last_baseline: f32Last alphabetic baseline, in pixels from the layout box’s top.
truncated: boolWhether TextRasterRequest::clamp discarded text.