OpenGUI::FontManager Class Reference

#include <OpenGUI_FontManager.h>

List of all members.


Detailed Description

Provides font loading and texture UV generation for glyphs loaded from fonts.


Public Types

typedef std::list< std::string > FontList
 a list of font names that are currently loaded in the FontManager, retrieved by FontManager::getFontList()

Public Member Functions

FontSetPtr RegisterFontSet (std::string filename, std::string fontName)
 Registers a new font.
void SetDefaultFont (Font font)
 Sets the default font.
Font GetDefaultFont ()
 Retrieves the default font.
void UnRegisterFontSet (Font font)
 UnRegisters a loaded font by handle.
void UnRegisterFontSet (const std::string &fontName)
 UnRegisters a loaded font by name.
void UnRegisterFontSet (FontSetPtr fontSet)
 UnRegisters a loaded font by FontSetPtr.
FontSetPtr GetFontSet (const std::string &fontName)
 Retrieves a font by name.
FontList getFontList ()
 Returns a FontList containing the names of all loaded fonts, which can then be fed to GetFontSet() or used with Font.
ImageryPtrList _getFontAtlases ()
 Returns an ImageryPtrList containing ImageryPtrs for each font atlas.

Static Public Member Functions

static FontManagergetSingleton (void)
 Retrieve the current singleton, if one exists. If none exists, this will cause an error.
static FontManagergetSingletonPtr (void)
 Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0.


Member Typedef Documentation

typedef std::list<std::string> OpenGUI::FontManager::FontList

a list of font names that are currently loaded in the FontManager, retrieved by FontManager::getFontList()


Member Function Documentation

ImageryPtrList OpenGUI::FontManager::_getFontAtlases (  ) 

Returns an ImageryPtrList containing ImageryPtrs for each font atlas.

This is a debugging tool, so you can retrieve and display font atlases in their raw form. The validity of the returned list is very short, and it can easily become invalidated by calls to render new font glyphs or by the loading and unloading of FontSets. The best course of action is to use the obtained information immediately, and re-request it each time you need it (especially between frames) as its contents could have changed.

Note:
This function is by no means fast, as it is not optimized for production use.

Font OpenGUI::FontManager::GetDefaultFont (  ) 

Retrieves the default font.

FontManager::FontList OpenGUI::FontManager::getFontList (  ) 

Returns a FontList containing the names of all loaded fonts, which can then be fed to GetFontSet() or used with Font.

FontSetPtr OpenGUI::FontManager::GetFontSet ( const std::string &  fontName  ) 

Retrieves a font by name.

FontManager & OpenGUI::FontManager::getSingleton ( void   )  [static]

Retrieve the current singleton, if one exists. If none exists, this will cause an error.

FontManager * OpenGUI::FontManager::getSingletonPtr ( void   )  [static]

Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0.

FontSetPtr OpenGUI::FontManager::RegisterFontSet ( std::string  filename,
std::string  fontName 
)

Registers a new font.

If an existing font already exists with the same fontName, it will replaced by the new font. This will only affect newly created Font handles, and does not update the default font if the replaced font was also the default font.

Note:
The first font registered is automatically set as the default using fontSize = 12. To manually set the default font to something else, use SetDefaultFont().

void OpenGUI::FontManager::SetDefaultFont ( Font  font  ) 

Sets the default font.

This sets the default font and font size (in points) that is used when no font is specified.

void OpenGUI::FontManager::UnRegisterFontSet ( FontSetPtr  fontSet  ) 

UnRegisters a loaded font by FontSetPtr.

void OpenGUI::FontManager::UnRegisterFontSet ( const std::string &  fontName  ) 

UnRegisters a loaded font by name.

void OpenGUI::FontManager::UnRegisterFontSet ( Font  font  )  [inline]

UnRegisters a loaded font by handle.

This function will bind the given Font handle if it is not already bound.


The documentation for this class was generated from the following files:
Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Fri Jan 5 23:05:25 2007