#include <FontManager.h>
Public Member Functions | |
| void | registerFont (const string &fontname, const string &filename, const string &filenameBold) |
| Registers a font for use in the Font Manager. | |
| void | bindStandard (const string &fontname) |
| Binds the standard texture of a font in OpenGL. | |
| void | bindBold (const string &fontname) |
| Binds the bold texture of a font in OpenGL. | |
| Texture * | getStandardTexture (const string &fontname) |
| Returns the standard texture of a font. | |
| Texture * | getBoldTexture (const string &fontname) |
| Returns the bold texture of a font. | |
| struct fontCoords * | getStandardCoords (const string &fontname) |
| Returns the coordinate sets of the standard styled texture of a font. | |
| struct fontCoords * | getBoldCoords (const string &fontname) |
| Returns the coordinate sets of the bold styled texture of a font. | |
| virtual string | toString () const |
| Returns a textual representation. | |
| virtual string | className () const |
| Returns the class name of the object. | |
| virtual enum classId | classId () const |
| Returns the class id of the object. | |
Static Public Member Functions | |
| static FontManager * | getInstance () |
| The getter for the singleton instance. | |
Private Member Functions | |
| FontManager () | |
| The constructor. | |
| FontManager (const FontManager &source) | |
| The copy constructor. | |
| ~FontManager () | |
| The destructor. | |
| ILubyte | getPixelAlpha (const ILuint &x, const ILuint &y) |
| Gets a pixel's alpha value from the active DevIL image (top left origin). | |
| void | getMinMax (const unsigned char &charId, Uint32 &min, Uint32 &max) |
| Gets the left and right border of a character in the active DevIL image. | |
| void | generateFontCoords (Texture &texture, struct fontCoords *coords) |
| Generates a font coordinates set from a texture. | |
Private Attributes | |
| vector< fontEntry > | fonts |
| The place to store all information about loaded textures. | |
Static Private Attributes | |
| static FontManager * | instance = 0 |
| The singleton instance of this Manager. | |
| FontManager::FontManager | ( | ) | [private] |
The constructor.
Initializes the font manager.
| FontManager::FontManager | ( | const FontManager & | source | ) | [private] |
The copy constructor.
Should not be called.
| FontManager::~FontManager | ( | ) | [private] |
The destructor.
Destroyes the texture manager and frees all memory occupied by textures. Should not be called.
| ILubyte FontManager::getPixelAlpha | ( | const ILuint & | x, | |
| const ILuint & | y | |||
| ) | [private] |
Gets a pixel's alpha value from the active DevIL image (top left origin).
Returns the grayscale value of the active grayscale image at the coordinates x and y with the origin in the top left corner.
| x | The x coordinate | |
| y | The y coordinate |
| void FontManager::getMinMax | ( | const unsigned char & | charId, | |
| Uint32 & | min, | |||
| Uint32 & | max | |||
| ) | [private] |
Gets the left and right border of a character in the active DevIL image.
calculates the coordinates of the right quad
| charId | The Id (0..255) of the Character whose position is wanted | |
| charXmin | The minimal x Coordinate of the character | |
| charYmax | The minimal y coordinate of the character |
| void FontManager::generateFontCoords | ( | Texture & | texture, | |
| struct fontCoords * | coords | |||
| ) | [private] |
Generates a font coordinates set from a texture.
| FontManager * FontManager::getInstance | ( | ) | [static] |
The getter for the singleton instance.
The only way to access the manager
| void FontManager::registerFont | ( | const string & | fontname, | |
| const string & | filename, | |||
| const string & | filenameBold | |||
| ) |
Registers a font for use in the Font Manager.
Adds a font if not already present.
| void FontManager::bindStandard | ( | const string & | fontname | ) |
Binds the standard texture of a font in OpenGL.
Makes the font's standard texture the active texture to use in OpenGL.
| filename | Must be a fontname already registered otherwise the call will have no effect. |
| void FontManager::bindBold | ( | const string & | fontname | ) |
Binds the bold texture of a font in OpenGL.
Makes the font's standard texture the active texture to use in OpenGL.
| filename | Must be a fontname already registered otherwise the call will have no effect. |
| Texture * FontManager::getStandardTexture | ( | const string & | fontname | ) |
Returns the standard texture of a font.
| fontname | Must be a fontname already registered otherwise the call returns 0. This returns the standard styled font texture. |
| Texture * FontManager::getBoldTexture | ( | const string & | fontname | ) |
Returns the bold texture of a font.
| fontname | Must be a fontname already registered otherwise the call returns 0. This returns the bold styled font texture. |
| struct fontCoords * FontManager::getStandardCoords | ( | const string & | fontname | ) | [read] |
Returns the coordinate sets of the standard styled texture of a font.
| struct fontCoords * FontManager::getBoldCoords | ( | const string & | fontname | ) | [read] |
Returns the coordinate sets of the bold styled texture of a font.
| string FontManager::toString | ( | ) | const [virtual] |
Returns a textual representation.
| string FontManager::className | ( | ) | const [virtual] |
Returns the class name of the object.
| enum classId FontManager::classId | ( | ) | const [virtual] |
Returns the class id of the object.
FontManager * FontManager::instance = 0 [static, private] |
The singleton instance of this Manager.
vector<fontEntry> FontManager::fonts [private] |
The place to store all information about loaded textures.
1.5.6