#include <juce_TextLayout.h>
A Pre-formatted piece of text, which may contain multiple fonts and colours.
A TextLayout is created from an AttributedString, and once created can be quickly drawn into a Graphics context.
- See also
- AttributedString
TextLayout::TextLayout |
( |
| ) |
|
TextLayout::~TextLayout |
( |
| ) |
|
void TextLayout::addLine |
( |
Line * |
line | ) |
|
Adds a line to the layout. The layout will take ownership of this line object and will delete it when it is no longer needed.
Creates a layout from the given attributed string. This will replace any data that is currently stored in the layout.
Creates a layout from the given attributed string, given some size constraints. This will replace any data that is currently stored in the layout.
Creates a layout, attempting to choose a width which results in lines of a similar length.
This will be slower than the normal createLayout method, but produces a tidier result.
void TextLayout::createLayoutWithBalancedLineLengths |
( |
const AttributedString & |
text, |
|
|
float |
maxWidth, |
|
|
float |
maxHeight |
|
) |
| |
Creates a layout, attempting to choose a width which results in lines of a similar length.
This will be slower than the normal createLayout method, but produces a tidier result.
Draws the layout within the specified area. The position of the text within the rectangle is controlled by the justification flags set in the original AttributedString that was used to create this layout.
void TextLayout::ensureStorageAllocated |
( |
int |
numLinesNeeded | ) |
|
Pre-allocates space for the specified number of lines.
float TextLayout::getHeight |
( |
| ) |
const |
|
inlinenoexcept |
Returns the maximum height of the content.
Returns one of the lines.
int TextLayout::getNumLines |
( |
| ) |
const |
|
inlinenoexcept |
Returns the number of lines in the layout.
float TextLayout::getWidth |
( |
| ) |
const |
|
inlinenoexcept |
Returns the maximum width of the content.
The documentation for this class was generated from the following files: