A text string with a set of colour/font settings that are associated with sub-ranges of the text.
More...
|
| | AttributedString ()=default |
| | Creates an empty attributed string. More...
|
| |
| | AttributedString (const String &newString) |
| | Creates an attributed string with the given text. More...
|
| |
| | AttributedString (const AttributedString &)=default |
| |
| AttributedString & | operator= (const AttributedString &)=default |
| |
| | AttributedString (AttributedString &&) noexcept=default |
| |
| AttributedString & | operator= (AttributedString &&) noexcept=default |
| |
| const String & | getText () const noexcept |
| | Returns the complete text of this attributed string. More...
|
| |
| void | setText (const String &newText) |
| | Replaces all the text. More...
|
| |
| void | append (const String &textToAppend) |
| | Appends some text (with a default font and colour). More...
|
| |
| void | append (const String &textToAppend, const Font &font) |
| | Appends some text, with a specified font, and the default colour (black). More...
|
| |
| void | append (const String &textToAppend, Colour colour) |
| | Appends some text, with a specified colour, and the default font. More...
|
| |
| void | append (const String &textToAppend, const Font &font, Colour colour) |
| | Appends some text, with a specified font and colour. More...
|
| |
| void | append (const AttributedString &other) |
| | Appends another AttributedString to this one. More...
|
| |
| void | clear () |
| | Resets the string, clearing all text and attributes. More...
|
| |
| void | draw (Graphics &g, const Rectangle< float > &area) const |
| | Draws this string within the given area. More...
|
| |
| Justification | getJustification () const noexcept |
| | Returns the justification that should be used for laying-out the text. More...
|
| |
| void | setJustification (Justification newJustification) noexcept |
| | Sets the justification that should be used for laying-out the text. More...
|
| |
| WordWrap | getWordWrap () const noexcept |
| | Returns the word-wrapping behaviour. More...
|
| |
| void | setWordWrap (WordWrap newWordWrap) noexcept |
| | Sets the word-wrapping behaviour. More...
|
| |
| ReadingDirection | getReadingDirection () const noexcept |
| | Returns the reading direction for the text. More...
|
| |
| void | setReadingDirection (ReadingDirection newReadingDirection) noexcept |
| | Sets the reading direction that should be used for the text. More...
|
| |
| float | getLineSpacing () const noexcept |
| | Returns the extra line-spacing distance. More...
|
| |
| void | setLineSpacing (float newLineSpacing) noexcept |
| | Sets an extra line-spacing distance. More...
|
| |
| int | getNumAttributes () const noexcept |
| | Returns the number of attributes that have been added to this string. More...
|
| |
| const Attribute & | getAttribute (int index) const noexcept |
| | Returns one of the string's attributes. More...
|
| |
| void | setColour (Range< int > range, Colour colour) |
| | Adds a colour attribute for the specified range. More...
|
| |
| void | setColour (Colour colour) |
| | Removes all existing colour attributes, and applies this colour to the whole string. More...
|
| |
| void | setFont (Range< int > range, const Font &font) |
| | Adds a font attribute for the specified range. More...
|
| |
| void | setFont (const Font &font) |
| | Removes all existing font attributes, and applies this font to the whole string. More...
|
| |
A text string with a set of colour/font settings that are associated with sub-ranges of the text.
An attributed string lets you create a string with varied fonts, colours, word-wrapping, layout, etc., and draw it using AttributedString::draw().
- See also
- TextLayout