#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
@tags{Graphics}
◆ const_iterator
◆ iterator
◆ TextLayout() [1/3]
| juce::TextLayout::TextLayout |
( |
| ) |
|
Creates an empty layout. Having created a TextLayout, you can populate it using createLayout() or createLayoutWithBalancedLineLengths().
◆ TextLayout() [2/3]
| juce::TextLayout::TextLayout |
( |
const TextLayout & | other | ) |
|
◆ TextLayout() [3/3]
| juce::TextLayout::TextLayout |
( |
TextLayout && | other | ) |
|
|
noexcept |
◆ ~TextLayout()
| juce::TextLayout::~TextLayout |
( |
| ) |
|
◆ addLine()
| void juce::TextLayout::addLine |
( |
std::unique_ptr< 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.
◆ begin() [1/2]
Returns an iterator over the lines of content
◆ begin() [2/2]
◆ cbegin()
◆ cend()
◆ createLayout() [1/2]
Creates a layout from the given attributed string. This will replace any data that is currently stored in the layout.
◆ createLayout() [2/2]
Creates a layout from the given attributed string, given some size constraints. This will replace any data that is currently stored in the layout.
◆ createLayoutWithBalancedLineLengths() [1/2]
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.
◆ createLayoutWithBalancedLineLengths() [2/2]
| void juce::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.
◆ createNativeLayout()
◆ createStandardLayout()
◆ draw()
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.
◆ end() [1/2]
Returns an iterator over the lines of content
◆ end() [2/2]
◆ ensureStorageAllocated()
| void juce::TextLayout::ensureStorageAllocated |
( |
int | numLinesNeeded | ) |
|
Pre-allocates space for the specified number of lines.
◆ getHeight()
| float juce::TextLayout::getHeight |
( |
| ) |
const |
|
inlinenoexcept |
Returns the maximum height of the content.
◆ getLine()
Returns one of the lines.
◆ getNumLines()
| int juce::TextLayout::getNumLines |
( |
| ) |
const |
|
inlinenoexcept |
Returns the number of lines in the layout.
◆ getWidth()
| float juce::TextLayout::getWidth |
( |
| ) |
const |
|
inlinenoexcept |
Returns the maximum width of the content.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ recalculateSize()
| void juce::TextLayout::recalculateSize |
( |
| ) |
|
If you modify the TextLayout after creating it, call this to compute the new dimensions of the content.
◆ height
| float juce::TextLayout::height |
|
private |
◆ justification
◆ lines
◆ width
| float juce::TextLayout::width |
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/modules/juce_graphics/fonts/juce_TextLayout.h
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/modules/juce_graphics/fonts/juce_TextLayout.cpp
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/modules/juce_graphics/native/juce_linux_Fonts.cpp
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp