xoreos
0.0.5
|
#include <ttffont.h>
Classes | |
struct | Char |
A font character. More... | |
struct | Page |
A texture page filled with characters. More... | |
Public Member Functions | |
TTFFont (Common::SeekableReadStream *ttf, int height) | |
TTFFont (const Common::UString &name, int height) | |
~TTFFont () | |
float | getWidth (uint32 c) const |
Return the width of a character. More... | |
float | getHeight () const |
Return the height of a character. More... | |
void | draw (uint32 c) const |
Draw this character. More... | |
void | buildChars (const Common::UString &str) |
Build all necessary characters to display this string. More... | |
Public Member Functions inherited from Graphics::Font | |
Font () | |
virtual | ~Font () |
virtual float | getLineSpacing () const |
Return the size of space between lines. More... | |
size_t | getLineCount (const Common::UString &text, float maxWidth=0.0f, float maxHeight=0.0f) const |
Return the number of lines this text spans. More... | |
float | getWidth (const Common::UString &text, float maxWidth=0.0f) const |
Return the width this string would take. More... | |
float | getHeight (const Common::UString &text, float maxWidth=0.0f, float maxHeight=0.0f) const |
Return the height this string would take. More... | |
float | getLineWidth (const Common::UString &text) const |
Return the width of this string. More... | |
virtual void | renderBind (const glm::mat4 &transform) const |
virtual void | render (uint32 c, float &x, float &y, float *rgba) const |
virtual void | renderUnbind () const |
float | split (const Common::UString &line, std::vector< Common::UString > &lines, float maxWidth=0.0f, float maxHeight=0.0f, bool trim=true) const |
float | split (Common::UString &line, float maxWidth, float maxHeight=0.0f, bool trim=true) const |
float | split (const Common::UString &line, Common::UString &lines, float maxWidth, float maxHeight=0.0f, bool trim=true) const |
Private Member Functions | |
void | load (Common::SeekableReadStream *ttf, int height) |
void | rebuildPages () |
void | addChar (uint32 c) |
void | drawMissing () const |
Private Attributes | |
Common::ScopedPtr< TTFRenderer > | _ttf |
Common::PtrVector< Page > | _pages |
std::map< uint32, Char > | _chars |
std::map< uint32, Char >::const_iterator | _missingChar |
float | _missingWidth |
uint32 | _height |
Graphics::Aurora::TTFFont::TTFFont | ( | Common::SeekableReadStream * | ttf, |
int | height | ||
) |
Definition at line 67 of file ttffont.cpp.
References load().
Graphics::Aurora::TTFFont::TTFFont | ( | const Common::UString & | name, |
int | height | ||
) |
Definition at line 71 of file ttffont.cpp.
References Common::UString::c_str(), Aurora::kFileTypeTTF, load(), and ResMan.
Graphics::Aurora::TTFFont::~TTFFont | ( | ) |
Definition at line 79 of file ttffont.cpp.
|
private |
Definition at line 181 of file ttffont.cpp.
References _chars, _height, _pages, _ttf, Graphics::Aurora::TTFFont::Page::curX, Graphics::Aurora::TTFFont::Page::curY, Common::exceptionDispatcherWarning(), kPageHeight, kPageWidth, Graphics::Aurora::TTFFont::Char::page, Graphics::Aurora::TTFFont::Char::tX, Graphics::Aurora::TTFFont::Char::tY, Graphics::Aurora::TTFFont::Char::vX, Graphics::Aurora::TTFFont::Char::vY, and Graphics::Aurora::TTFFont::Char::width.
Referenced by buildChars(), and load().
|
virtual |
Build all necessary characters to display this string.
Reimplemented from Graphics::Font.
Definition at line 169 of file ttffont.cpp.
References addChar(), Common::UString::begin(), Common::UString::end(), and rebuildPages().
|
virtual |
Draw this character.
Implements Graphics::Font.
Definition at line 143 of file ttffont.cpp.
References _chars, _missingChar, _pages, drawMissing(), and TextureMan.
|
private |
Definition at line 128 of file ttffont.cpp.
References _height, _missingWidth, and TextureMan.
Referenced by draw().
|
virtual |
Return the height of a character.
Implements Graphics::Font.
Definition at line 124 of file ttffont.cpp.
References _height.
|
virtual |
Return the width of a character.
Implements Graphics::Font.
Definition at line 116 of file ttffont.cpp.
References _chars, and _missingWidth.
|
private |
Definition at line 82 of file ttffont.cpp.
References _chars, _height, _missingChar, _missingWidth, _ttf, addChar(), kPageHeight, and rebuildPages().
Referenced by TTFFont().
|
private |
Definition at line 176 of file ttffont.cpp.
References _pages.
Referenced by buildChars(), and load().
|
private |
Definition at line 101 of file ttffont.h.
Referenced by addChar(), drawMissing(), getHeight(), and load().
|
private |
Definition at line 99 of file ttffont.h.
Referenced by drawMissing(), getWidth(), and load().
|
private |
Definition at line 95 of file ttffont.h.
Referenced by addChar(), draw(), and rebuildPages().
|
private |