Skip to main content

Measure

Type Alias Measure 

Source
pub type Measure<'a> = dyn FnMut(&TextContent, Option<f32>) -> (f32, f32) + 'a;
Expand description

Callback that measures a text block: (text, font_size, weight, wrap, max_width) -> (w, h). Measures a text node to (width, height) given an optional max width. Takes the whole TextContent so new text properties (family, spacing, style…) don’t each widen this signature.