Class providing a shared library of Font objects to the system. More...
Public Member Functions | |
Font | createFont (string filename, string resourceGroup="") |
Creates a new font from a font definition file, and returns a pointer to the new Font object. | |
Font | createFont (string type, string name, string fontname, string resourceGroup="") |
Creates a new Font based on a true-type font, and returns a pointer to the new Font object. | |
void | destroyFont (string name) |
Destroy's the font with the given name. | |
void | destroyFont (Font font) |
Destroys the given Font object. | |
void | destroyAllFonts () |
Destroys all Font objects registered in the system. | |
bool | isFontPresent (string name) |
Checks the existence of a given font. | |
Font | getFont (string name) |
Returns a pointer to the font object with the specified name. | |
void | notifyScreenResolution (Size size) |
Notify the FontManager of the current (usually new) display resolution. |
Qualified Iterators | |
Font | Font |
Can be used to iterate over the available Font objects. |
Class providing a shared library of Font objects to the system.
The FontManager is used to create, access, and destroy Font objects. The idea is that the FontManager will function as a central repository for Font objects used within the GUI system, and that those Font objects can be accessed, via a unique name, by any interested party within the system.
Font GUI::FontManager::createFont | ( | string | filename, |
string | resourceGroup = "" |
||
) |
Creates a new font from a font definition file, and returns a pointer to the new Font object.
filename | String object containing the filename of a 'font definition file' what will be used to create the new font |
resourceGroup | Resource group identifier to pass to the resource provider when loading the font definition file. |
FileIOException | thrown if there was some problem accessing or parsing the file filename |
InvalidRequestException | thrown if an invalid filename was provided. |
AlreadyExistsException | thrown if a Font already exists with the name specified, or if a font Imageset clashes with one already defined in the system. |
GenericException | thrown if something goes wrong while accessing a true-type font referenced in file filename. |
RendererException | thrown if the Renderer can't support a texture large enough to hold the requested glyph imagery. |
MemoryException | thrown if allocation of imagery construction buffer fails. |
Font GUI::FontManager::createFont | ( | string | type, |
string | name, | ||
string | fontname, | ||
string | resourceGroup = "" |
||
) |
Creates a new Font based on a true-type font, and returns a pointer to the new Font object.
type | String object containing the type of the font to be created (same as in the "Type" attribute of the font XML). |
name | String object containing a unique name for the new font. |
fontname | String object containing the name and path of the true-type font to access. |
resourceGroup | Resource group identifier to be passed to the resource provider when loading the font definition file. |
AlreadyExistsException | thrown if a Font already exists with the name specified, or if a font Imageset clashes with one already defined in the system. |
GenericException | thrown if something goes wrong while accessing a true-type font referenced in file fontname. |
RendererException | thrown if the Renderer can't support a texture large enough to hold the requested glyph imagery. |
MemoryException | thrown if allocation of imagery construction buffer fails. |
void GUI::FontManager::destroyFont | ( | string | name | ) |
Destroy's the font with the given name.
name | String object containing the name of the font to be destroyed. If the specified font does not exist, nothing happens. |
void GUI::FontManager::destroyFont | ( | Font | font | ) |
void GUI::FontManager::destroyAllFonts | ( | ) |
Destroys all Font objects registered in the system.
bool GUI::FontManager::isFontPresent | ( | string | name | ) |
Font GUI::FontManager::getFont | ( | string | name | ) |
void GUI::FontManager::notifyScreenResolution | ( | Size | size | ) |
Notify the FontManager of the current (usually new) display resolution.
size | Size object describing the display resolution |