openshot-audio  0.1.7
Classes | Public Types | Public Member Functions | List of all members
AttributedString Class Reference

#include <juce_AttributedString.h>

Classes

class  Attribute
 

Public Types

enum  WordWrap { none, byWord, byChar }
 
enum  ReadingDirection { natural, leftToRight, rightToLeft }
 

Public Member Functions

 AttributedString ()
 
 AttributedString (const String &text)
 
 AttributedString (const AttributedString &)
 
AttributedStringoperator= (const AttributedString &)
 
 ~AttributedString ()
 
const StringgetText () const noexcept
 
void setText (const String &newText)
 
void append (const String &textToAppend)
 
void append (const String &textToAppend, const Font &font)
 
void append (const String &textToAppend, Colour colour)
 
void append (const String &textToAppend, const Font &font, Colour colour)
 
void append (const AttributedString &other)
 
void clear ()
 
void draw (Graphics &g, const Rectangle< float > &area) const
 
Justification getJustification () const noexcept
 
void setJustification (Justification newJustification) noexcept
 
WordWrap getWordWrap () const noexcept
 
void setWordWrap (WordWrap newWordWrap) noexcept
 
ReadingDirection getReadingDirection () const noexcept
 
void setReadingDirection (ReadingDirection newReadingDirection) noexcept
 
float getLineSpacing () const noexcept
 
void setLineSpacing (float newLineSpacing) noexcept
 
int getNumAttributes () const noexcept
 
const AttributegetAttribute (int index) const noexcept
 
void setColour (Range< int > range, Colour colour)
 
void setColour (Colour colour)
 
void setFont (Range< int > range, const Font &font)
 
void setFont (const Font &font)
 

Detailed Description

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

Member Enumeration Documentation

◆ ReadingDirection

Types of reading direction that can be used.

See also
getReadingDirection, setReadingDirection
Enumerator
natural 
leftToRight 
rightToLeft 

◆ WordWrap

Types of word-wrap behaviour.

See also
getWordWrap, setWordWrap
Enumerator
none 

No word-wrapping: lines extend indefinitely.

byWord 

Lines are wrapped on a word boundary.

byChar 

Lines are wrapped on a character boundary.

Constructor & Destructor Documentation

◆ AttributedString() [1/3]

AttributedString::AttributedString ( )

Creates an empty attributed string.

◆ AttributedString() [2/3]

AttributedString::AttributedString ( const String text)
explicit

Creates an attributed string with the given text.

◆ AttributedString() [3/3]

AttributedString::AttributedString ( const AttributedString other)