pub fn height_for_width(
p: &mut dyn Painter,
style: &TextStyle,
msg: &str,
width: u32,
wrap: Wrap,
max_lines: Option<usize>,
) -> u32Expand description
Measures the height of wrapped text for a given width, so a layout can give a label the height it needs.
§Arguments
p- The painter (it measures).style- The font.msg- The text.width- The width in pixels the text will be drawn at.wrap- How lines break;Wrap::Noneis one line per\n.max_lines- The most lines, orNone.
§Returns
The height in pixels: the number of lines times the line height.