#include <font_manager.h>
Inherits UniversalManager< Font, FontManager >, and Task.
Inheritance diagram for FontManager:


Public Member Functions | |
| TRef | get (const char *font_name, int size) |
| Get some font. | |
| virtual void | update (int dtime, int atime) |
| Font's cache cleanup. | |
Protected Member Functions | |
| FontManager () | |
| ~FontManager () | |
Private Attributes | |
| int | mNextCleanup |
| Miliseconds until next cleanup. | |
Friends | |
| class | Singleton< FontManager > |
| Singleton if a friend of mine! (stupid solution...). | |
Usage:
FontRef font; // create font = FontManager::getRef().get("FreeMono.ttf", 20); .. font->RenderUTF8("Hello World!", 30, 30); // usage .. font = 0; // destroy
The manager is derived from Task becasue fonts need to clean cache sometimes so regular call to FontManager is needed. You may run out of memory if you don't call update :-) The manager isn't thread safe.
Definition at line 33 of file font_manager.h.
|
|
Definition at line 30 of file font_manager.cpp. References mNextCleanup. |
|
|
Definition at line 35 of file font_manager.cpp. |
|
||||||||||||
|
Get some font. Same font (reference) may be returned in mutiple calls.
Definition at line 40 of file font_manager.cpp. References UniversalManager< Font, FontManager >::createAndRegister(), DIE(), UniversalManager< Font, FontManager >::find(), locateFile(), LOGE, and xtos(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Font's cache cleanup. We need this because font's caches must be regullary cleaned. Should be called from task. Reimplemented from Task. Definition at line 63 of file font_manager.cpp. References LOGT, mNextCleanup, and UniversalManager< Font, FontManager >::mRegister. |
|
|
Singleton if a friend of mine! (stupid solution...).
Definition at line 36 of file font_manager.h. |
|
|
Miliseconds until next cleanup.
Definition at line 63 of file font_manager.h. Referenced by FontManager(), and update(). |
1.4.5