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,
}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.
Trait Implementations§
Source§impl Clone for TextMeasure
impl Clone for TextMeasure
Source§impl Debug for TextMeasure
impl Debug for TextMeasure
Source§impl PartialEq for TextMeasure
impl PartialEq for TextMeasure
impl StructuralPartialEq for TextMeasure
Auto Trait Implementations§
impl Freeze for TextMeasure
impl RefUnwindSafe for TextMeasure
impl Send for TextMeasure
impl Sync for TextMeasure
impl Unpin for TextMeasure
impl UnsafeUnpin for TextMeasure
impl UnwindSafe for TextMeasure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more