pub struct MultiLineText<'a, Coord, T: Borrow<str>> { /* private fields */ }
Expand description

An multi-line text element. The Text element allows only single line text and the MultiLineText supports drawing multiple lines

Implementations

Create an empty multi-line text element. Lines can be append to the empty multi-line by calling push_line method

pos: The upper left corner style: The style of the text

Set the line height of the multi-line text element

Push a new line into the given multi-line text line: The line to be pushed

Estimate the multi-line text element’s dimension

Move the location to the specified location

Compute the line layout

Parse a multi-line text into an multi-line element.

text: The text that is parsed pos: The position of the text style: The style for this text max_width: The width of the multi-line text element, the line will break into two lines if the line is wider than the max_width. If 0 is given, do not do any line wrapping

Parse a multi-line text into an multi-line element.

text: The text that is parsed pos: The position of the text style: The style for this text max_width: The width of the multi-line text element, the line will break into two lines if the line is wider than the max_width. If 0 is given, do not do any line wrapping

Trait Implementations

Actually draws the element. The key points is already translated into the image coordinate and can be used by DC directly Read more

The item in point iterator

The point iterator

framework to do the coordinate mapping

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.