Skip to main content

wrap_lines

Function wrap_lines 

Source
pub fn wrap_lines(
    text: &str,
    max_width: f32,
    font_asset: Option<&'static FontAsset>,
    font_size: u16,
    measure_fn: &dyn Fn(&str, &TextConfig) -> Dimensions,
) -> Vec<VisualLine>
Expand description

Word-wrap text into visual lines that fit within max_width. Splits on ā€˜\n’ first (hard breaks), then wraps long lines at word boundaries. If max_width <= 0, no wrapping occurs (equivalent to split_lines).