Graphics::TextObject Class Reference

A block of text consisting of zero or more segments. More...

#include <Object.h>

Inheritance diagram for Graphics::TextObject:
Collaboration diagram for Graphics::TextObject:

Classes

class  ColorElement
 
class  Element
 
class  FontElement
 
class  RunElement
 
class  TextElement
 

Public Member Functions

 TextObject (const Rect &bounds)
 
void write (MetaWriter &meta) const override
 
RenderercreateRenderer (const Location &location) const override
 Create a software renderer for this object. More...
 
template<typename T >
T * addElement (T *elem)
 
TextElementaddText (const TextAsset &text)
 
FontElementaddFont (const Font &font, Scale scale, FontStyles style)
 
FontElementaddFont (const TypeFace &typeface, Scale scale, FontStyles style)
 
ColorElementaddColor (const Brush &fore, const Brush &back)
 
RunElementaddRun (Point pos, uint16_t width, uint16_t offset, uint8_t length)
 
- Public Member Functions inherited from Graphics::ObjectTemplate< Object::Kind::Text >
Kind kind () const override
 
- Public Member Functions inherited from Graphics::Object
virtual Kind kind () const =0
 
bool operator== (const Object &other) const
 
virtual String getTypeStr () const
 
- Public Member Functions inherited from LinkedObjectTemplate< Object >
Object * getNext () const
 
bool insertAfter (Object *object)
 
Iterator begin () const
 
Iterator end () const
 
Iterator cbegin () const
 
Iterator cend () const
 
- Public Member Functions inherited from LinkedObject
virtual ~LinkedObject ()
 
virtual LinkedObjectnext () const
 
bool insertAfter (LinkedObject *object)
 
bool operator== (const LinkedObject &other) const
 
bool operator!= (const LinkedObject &other) const
 

Public Attributes

Rect bounds {}
 
Element::OwnedList elements
 

Additional Inherited Members

- Public Types inherited from Graphics::Object
enum  Kind { Kind::XX }
 
using List = LinkedObjectListTemplate< Object >
 
using OwnedList = OwnedLinkedObjectListTemplate< Object >
 
- Public Types inherited from LinkedObjectTemplate< Object >
using Iterator = IteratorTemplate< Object, Object *, Object & >
 
using ConstIterator = IteratorTemplate< const Object, const Object *, const Object & >
 

Detailed Description

A block of text consisting of zero or more segments.

A segment is a straight run of text using a specific typeface and style.

Constructor & Destructor Documentation

◆ TextObject()

Graphics::TextObject::TextObject ( const Rect bounds)
inline

Member Function Documentation

◆ addColor()

ColorElement* Graphics::TextObject::addColor ( const Brush fore,
const Brush back 
)
inline

◆ addElement()

template<typename T >
T* Graphics::TextObject::addElement ( T *  elem)
inline

◆ addFont() [1/2]

FontElement* Graphics::TextObject::addFont ( const Font font,
Scale  scale,
FontStyles  style 
)
inline

◆ addFont() [2/2]

FontElement* Graphics::TextObject::addFont ( const TypeFace typeface,
Scale  scale,
FontStyles  style 
)
inline

◆ addRun()

RunElement* Graphics::TextObject::addRun ( Point  pos,
uint16_t  width,
uint16_t  offset,
uint8_t  length 
)
inline

◆ addText()

TextElement* Graphics::TextObject::addText ( const TextAsset text)
inline

◆ createRenderer()

Renderer* Graphics::TextObject::createRenderer ( const Location location) const
overridevirtual

Create a software renderer for this object.

Parameters
location
Return values
rendererReturned renderer object

Return nullptr if object cannot/should not be rendered

Implements Graphics::Object.

◆ write()

void Graphics::TextObject::write ( MetaWriter meta) const
inlineoverridevirtual

Implements Graphics::Object.

Member Data Documentation

◆ bounds

Rect Graphics::TextObject::bounds {}

◆ elements

Element::OwnedList Graphics::TextObject::elements

The documentation for this class was generated from the following file: