Skip to main content

text_advance_width

Function text_advance_width 

Source
pub fn text_advance_width(content: &str, font: &LoadedFont, scale: f32) -> f32
Expand description

Advance width of content in scaled pixels for the given font, for placing a caret, sizing a field’s text, or centring a line. Newlines carry no advance, so a multi-line string measures as if its lines were concatenated.