Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The FontManager class keeps a map associating a font path, size and smoothing flag to a Font object. More...
#include <FontManager.hpp>
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| FontManager (void *free_type_library=NULL) | |
| Constructor: uses the given FT_Library handle otherwise will initialize and use its own FT_Library. | |
| ~FontManager () | |
| Destructor: releases all fonts and disposes the FT_Library if not NULL. | |
| Font * | acquireFont (const String &font, int size, bool smooth=false) |
| Creates or returns an already created Font. | |
| const std::vector< ref< Font > > & | fonts () const |
| Returns the list of Fonts created till now. | |
| void | releaseFont (Font *font) |
| Releases a given Font and its associated resources and memory. | |
| void | releaseAllFonts () |
| Releases all Fonts and associated resources and memory. | |
| const void * | freeTypeLibrary () const |
| Returns the FT_Library handle. | |
| void * | freeTypeLibrary () |
| Returns the FT_Library handle. | |
| void * | setFreeTypeLibrary (void *ftlib) |
| Sets the FT_Library to the given one and returns the former one. | |
Protected Attributes | |
| std::vector< ref< Font > > | mFonts |
| void * | mFreeTypeLibrary |
The FontManager class keeps a map associating a font path, size and smoothing flag to a Font object.
Definition at line 45 of file FontManager.hpp.
| FontManager::FontManager | ( | void * | free_type_library = NULL ) |
Constructor: uses the given FT_Library handle otherwise will initialize and use its own FT_Library.
Definition at line 42 of file FontManager.cpp.
References vl::Log::error(), mFreeTypeLibrary, and VL_TRAP.
| FontManager::~FontManager | ( | ) |
Destructor: releases all fonts and disposes the FT_Library if not NULL.
If you don't want the FontManager to dispose the associated FT_Library then call setFreeTypeLibrary(NULL) before the FontManager is destroyed.
Definition at line 58 of file FontManager.cpp.
References mFreeTypeLibrary, and releaseAllFonts().
| virtual const char* vl::FontManager::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::Object.
Definition at line 48 of file FontManager.hpp.
Creates or returns an already created Font.
Definition at line 68 of file FontManager.cpp.
References fonts(), vl::ref< T >::get(), and mFonts.
Referenced by vl::VectorGraphics::setFont(), and vl::VolumePlot::VolumePlot().
Returns the list of Fonts created till now.
Definition at line 62 of file FontManager.hpp.
Referenced by acquireFont().
| void FontManager::releaseFont | ( | Font * | font ) |
Releases a given Font and its associated resources and memory.
Definition at line 87 of file FontManager.cpp.
References mFonts.
| void FontManager::releaseAllFonts | ( | ) |
Releases all Fonts and associated resources and memory.
Definition at line 94 of file FontManager.cpp.
References mFonts.
Referenced by ~FontManager().
| const void* vl::FontManager::freeTypeLibrary | ( | ) | const [inline] |
Returns the FT_Library handle.
Definition at line 71 of file FontManager.hpp.
| void* vl::FontManager::freeTypeLibrary | ( | ) | [inline] |
Returns the FT_Library handle.
Definition at line 74 of file FontManager.hpp.
| void* vl::FontManager::setFreeTypeLibrary | ( | void * | ftlib ) | [inline] |
Sets the FT_Library to the given one and returns the former one.
It is the user responsibility to dispose the returned one (if non-NULL).
Definition at line 78 of file FontManager.hpp.
std::vector< ref<Font> > vl::FontManager::mFonts [protected] |
Definition at line 81 of file FontManager.hpp.
Referenced by acquireFont(), releaseAllFonts(), and releaseFont().
void* vl::FontManager::mFreeTypeLibrary [protected] |
Definition at line 82 of file FontManager.hpp.
Referenced by FontManager(), and ~FontManager().