pub struct Layout<U: Copy + Clone = ()> { /* private fields */ }
Expand description

Text layout requires a small amount of heap usage which is contained in the Layout struct. This context is reused between layout calls. Reusing the Layout struct will greatly reduce memory allocations and is advisable for performance.

Implementations

Creates a layout instance. This requires the direction that the Y coordinate increases in. Layout needs to be aware of your coordinate system to place the glyphs correctly.

Resets the current layout settings and clears all appended text.

Keeps current layout settings but clears all appended text.

Gets the current height of the appended text.

Gets the currently positioned lines. If there are no lines positioned, this returns none.

Performs layout for text horizontally, and wrapping vertically. This makes a best effort attempt at laying out the text defined in the given styles with the provided layout settings. Text may overflow out of the bounds defined in the layout settings and it’s up to the application to decide how to deal with this.

Characters from the input string can only be omitted from the output, they are never reordered. The output buffer will always contain characters in the order they were defined in the styles.

Gets the currently laid out glyphs.

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.