pub fn paragraph(
p: &mut dyn Painter,
bounds: Rect,
style: &TextStyle,
color: Color,
msg: &str,
wrap: Wrap,
max_lines: Option<usize>,
) -> TextDrawnExpand description
Draws wrapped text: a block of lines, each aligned by style.justification within the
rectangle, centered vertically when the block fits (top-aligned when it doesn’t). Lines that
start below the rectangle are not drawn.
§Arguments
p- The painter, targeting theWidget.bounds- The rectangle to draw within, inWidgetcoordinates.style- The font and alignment.color- The text color.msg- The text;\nstarts a new line.wrap- How lines break (seewrap_text).max_lines- The most lines; the last is cut with an ellipsis if the text needs more.
§Returns
The size of the block drawn (0 by 0 if nothing was drawn) and whether the text was cut to
honor max_lines.