|
GG
|
#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 |
Used to encapsulate a token-like piece of text to be rendered using GG::Font.
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 |
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.
| Substring GG::Font::TextElement::text |
1.8.3