62 const
String& getText() const noexcept {
return text; }
68 void setText (
const String& newText);
71 void append (
const String& textToAppend);
73 void append (
const String& textToAppend,
const Font& font);
107 void setJustification (
Justification newJustification)
noexcept;
124 void setWordWrap (WordWrap newWordWrap)
noexcept;
141 void setReadingDirection (ReadingDirection newReadingDirection)
noexcept;
148 void setLineSpacing (
float newLineSpacing)
noexcept;
191 void setColour (
Colour colour);
197 void setFont (
const Font& font);
201 float lineSpacing = 0.0f;
203 WordWrap wordWrap = AttributedString::byWord;
204 ReadingDirection readingDirection = AttributedString::natural;
Holds a resizable array of primitive or copy-by-value objects.
An attribute that has been applied to a range of characters in an AttributedString.
Font font
The font for this range of characters.
Range< int > range
The range of characters to which this attribute will be applied.
A text string with a set of colour/font settings that are associated with sub-ranges of the text.
WordWrap getWordWrap() const noexcept
Returns the word-wrapping behaviour.
AttributedString()=default
Creates an empty attributed string.
AttributedString(const String &newString)
Creates an attributed string with the given text.
float getLineSpacing() const noexcept
Returns the extra line-spacing distance.
const Attribute & getAttribute(int index) const noexcept
Returns one of the string's attributes.
ReadingDirection
Types of reading direction that can be used.
int getNumAttributes() const noexcept
Returns the number of attributes that have been added to this string.
WordWrap
Types of word-wrap behaviour.
@ none
No word-wrapping: lines extend indefinitely.
@ byWord
Lines are wrapped on a word boundary.
@ byChar
Lines are wrapped on a character boundary.
ReadingDirection getReadingDirection() const noexcept
Returns the reading direction for the text.
Justification getJustification() const noexcept
Returns the justification that should be used for laying-out the text.
Represents a colour, also including a transparency value.
Represents a particular font, including its size, style, etc.
A graphics context, used for drawing a component or image.
Represents a type of justification to be used when positioning graphical items.
A general-purpose range object, that simply represents any linear range with a start and end point.
Manages a rectangle and allows geometric operations to be performed on it.
#define JUCE_LEAK_DETECTOR(OwnerClass)
This macro lets you embed a leak-detecting object inside a class.