#include <font_ttf.h>
Inherits Font.
Inheritance diagram for FontTTF:


Public Member Functions | |
| FontTTF (const char *file, int ptsize) | |
| virtual | ~FontTTF () |
| virtual void | RenderUTF8 (const std::string &utf8str, float x, float y) |
| Render UTF-8 encoded string. | |
| virtual int | Ascent () |
| Get line height. | |
| virtual void | cleanCache () |
| Clear the cache. | |
| virtual int | getWwidth () |
| Get width of W. | |
| virtual int | getTextWidth (const std::string &utf8str) |
| Get With of text in pixels. | |
Private Types | |
| typedef FontTTF::SCacheMember | SCacheMember |
| typedef STL_EXT_NS::hash_map< std::string, SCacheMember * > | TStringHash |
Private Attributes | |
| TTF_Font * | mFont |
| TStringHash | mRenderedCache |
| Rendered string. | |
| int | mWwidth |
| -1 means invalid / not measured yet | |
Classes | |
| struct | SCacheMember |
The font use caching of recently rendered strings. So if you render some string often it should be fast. But if you render different strings every frame the performance won't be good.
Definition at line 24 of file font_ttf.h.
|
|
|
|
|
Definition at line 66 of file font_ttf.h. |
|
||||||||||||
|
Definition at line 74 of file font_ttf.cpp. Here is the call graph for this function: ![]() |
|
|
Definition at line 94 of file font_ttf.cpp. References cleanCache(), and mFont. Here is the call graph for this function: ![]() |
|
|
Get line height. The value is usefull if you want to render multiline text and need to know height of line.
Implements Font. Definition at line 317 of file font_ttf.cpp. |
|
|
Clear the cache. Check the whole cache and delete members that weren't used for a long time. Reimplemented from Font. Definition at line 271 of file font_ttf.cpp. References LOGT, and mRenderedCache. Referenced by ~FontTTF(). |
|
|
Get With of text in pixels. Get width of utf-8 encoded text.
Implements Font. Definition at line 336 of file font_ttf.cpp. |
|
|
Get width of W. W is usuallu the most width char in font so you may use this as aproximation.
Implements Font. Definition at line 324 of file font_ttf.cpp. |
|
||||||||||||||||
|
Render UTF-8 encoded string. Render text to specified position. First call may be slower if implementation use some cache for rendered fonts.
Implements Font. Definition at line 201 of file font_ttf.cpp. References ConvertToRGBA(), DIE(), FontTTF::SCacheMember::h, LOGE, LOGT, mFont, mRenderedCache, FontTTF::SCacheMember::surface, SwapRows(), TIN, FontTTF::SCacheMember::usages, and FontTTF::SCacheMember::w. Here is the call graph for this function: ![]() |
|
|
Definition at line 54 of file font_ttf.h. Referenced by Ascent(), getTextWidth(), getWwidth(), RenderUTF8(), and ~FontTTF(). |
|
|
Rendered string.
Definition at line 68 of file font_ttf.h. Referenced by cleanCache(), and RenderUTF8(). |
|
|
-1 means invalid / not measured yet
Definition at line 70 of file font_ttf.h. Referenced by getWwidth(). |
1.4.5