[][src]Function newt::reflow_text

pub fn reflow_text(
    text: &str,
    width: i32,
    flex_down: i32,
    flex_up: i32
) -> (String, i32, i32)

Reflow text according to the provided specifications.

  • text - The text to be reformatted.
  • width - The target width of the text.
  • flex_down - The minimum difference from target width.
  • flex_up - The maximum difference from target width.

Returns the tuple (text, width, height) where text is the newly formatted text, width is the new width of the text, and height is the number of lines in the text.