Skip to main content

measure_layout

Function measure_layout 

Source
pub fn measure_layout(
    rasterizer: &TextRasterizer,
    root: &LayoutNode,
    time: MediaTime,
    size: RenderSize,
    canvas: (u32, u32),
) -> Result<LayoutBounds, TextError>
Expand description

Where each node of a valid layout tree lies on a picture of size, at picture time time, laid out with rasterizer’s fonts as a frame lays it out. canvas is the project canvas, which the tree’s pixel lengths are pixels of (the picture’s own size when they are measured at it). Rects are before the clip’s transform and before node visuals: layout boxes, not where they are drawn. An invalid tree gives unspecified rects, but never panics.

§Errors

Returns TextError::Raster when the text host refuses a text: no fonts, or a size out of range.