#include <Font.h>
Public Types | |
enum | TextElementType { OPEN_TAG, CLOSE_TAG, TEXT, WHITESPACE, NEWLINE } |
Public Member Functions | |
TextElement (bool ws, bool nl) | |
virtual | ~TextElement () |
virtual TextElementType | Type () const |
X | Width () const |
CPSize | CodePointSize () const |
Public Attributes | |
Substring | text |
std::vector< X > | widths |
const bool | whitespace |
const bool | newline |
Definition at line 188 of file Font.h.
The types of token-like entities that can be represented by a TextElement.
GG::Font::TextElement::TextElement | ( | bool | ws, | |
bool | nl | |||
) |
Ctor. ws indicates that the element contains only whitespace; nl indicates that it is a newline element.
virtual GG::Font::TextElement::~TextElement | ( | ) | [virtual] |
Virtual dtor.
virtual TextElementType GG::Font::TextElement::Type | ( | ) | const [virtual] |
Returns the TextElementType of the element.
Reimplemented in GG::Font::FormattingTag.
X GG::Font::TextElement::Width | ( | ) | const |
Returns the width of the element.
CPSize GG::Font::TextElement::CodePointSize | ( | ) | const |
Returns the number of code points in the original string that the element represents.
std::vector<X> GG::Font::TextElement::widths |
const bool GG::Font::TextElement::whitespace |
const bool GG::Font::TextElement::newline |