Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CEGUI::FontManager Class Reference

Class providing a shared library of Font objects to the system. More...

#include <CEGUIFontManager.h>

Inheritance diagram for CEGUI::FontManager:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::FontManager:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ConstBaseIterator<
FontRegistry > 
FontIterator

Public Member Functions

 FontManager (void)
 Constructor for FontManager objects.
 ~FontManager (void)
 Destructor for FontManager objects.
FontcreateFont (const String &filename, const String &resourceGroup="")
 Creates a new font from a font definition file, and returns a pointer to the new Font object.
FontcreateFont (const String &name, const String &fontname, uint size, uint flags, const String &resourceGroup="")
 Creates a new Font based on a true-type font, and returns a pointer to the new Font object.
void destroyFont (const String &name)
 Destroy's the font with the given name.
void destroyFont (Font *font)
 Destroys the given Font object.
void destroyAllFonts (void)
 Destroys all Font objects registered in the system.
bool isFontPresent (const String &name) const
 Checks the existence of a given font.
FontgetFont (const String &name) const
 Returns a pointer to the font object with the specified name.
void notifyScreenResolution (const Size &size)
 Notify the FontManager of the current (usually new) display resolution.
FontIterator getIterator (void) const
 Return a FontManager::FontIterator object to iterate over the available Font objects.

Static Public Member Functions

FontManagergetSingleton (void)
 Return singleton FontManager object.
FontManagergetSingletonPtr (void)
 Return pointer to singleton FontManager object.

Static Protected Attributes

FontManagerms_Singleton = NULL

Detailed Description

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.

Definition at line 54 of file CEGUIFontManager.h.


Member Typedef Documentation

typedef ConstBaseIterator<FontRegistry> CEGUI::FontManager::FontIterator
 

Definition at line 236 of file CEGUIFontManager.h.

Referenced by getIterator().


Constructor & Destructor Documentation

CEGUI::FontManager::FontManager void   ) 
 

Constructor for FontManager objects.

Definition at line 51 of file CEGUIFontManager.cpp.

References CEGUI::FontManager::FontManagerImplData::d_ftlib, and CEGUI::utf8.

CEGUI::FontManager::~FontManager void   ) 
 

Destructor for FontManager objects.

Definition at line 67 of file CEGUIFontManager.cpp.

References CEGUI::FontManager::FontManagerImplData::d_ftlib, destroyAllFonts(), and CEGUI::utf8.


Member Function Documentation

Font * CEGUI::FontManager::createFont const String name,
const String fontname,
uint  size,
uint  flags,
const String resourceGroup = ""
 

Creates a new Font based on a true-type font, and returns a pointer to the new Font object.

Parameters:
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.
size Specifies the glyph size (point-size) for the new font.
flags Some combination of FontFlag values to be used for the creation of this font.
resourceGroup Resource group identifier to be passed to the resource provider when loading the font definition file.
Returns:
Pointer to the newly created Font object.
Exceptions:
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.

Definition at line 106 of file CEGUIFontManager.cpp.

References CEGUI::FontManager::FontManagerImplData::d_ftlib, isFontPresent(), and CEGUI::utf8.

Font * CEGUI::FontManager::createFont const String filename,
const String resourceGroup = ""
 

Creates a new font from a font definition file, and returns a pointer to the new Font object.

Parameters:
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.
Returns:
Pointer the the newly created Font object
Exceptions:
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.

Definition at line 82 of file CEGUIFontManager.cpp.

References CEGUI::FontManager::FontManagerImplData::d_ftlib, CEGUI::Font::getName(), isFontPresent(), and CEGUI::utf8.

Referenced by CEGUI::Scheme::loadResources().

void CEGUI::FontManager::destroyAllFonts void   ) 
 

Destroys all Font objects registered in the system.

Returns:
Nothing

Definition at line 161 of file CEGUIFontManager.cpp.

References destroyFont().

Referenced by ~FontManager().

void CEGUI::FontManager::destroyFont Font font  ) 
 

Destroys the given Font object.

Parameters:
font Pointer to the Font to be destroyed. If no such Font exists, nothing happens.
Returns:
Nothing.

Definition at line 148 of file CEGUIFontManager.cpp.

References destroyFont(), and CEGUI::Font::getName().

void CEGUI::FontManager::destroyFont const String name  ) 
 

Destroy's the font with the given name.

Parameters:
name String object containing the name of the font to be destroyed. If the specified font does not exist, nothing happens.
Returns:
Nothing

Definition at line 128 of file CEGUIFontManager.cpp.

References CEGUI::utf8.

Referenced by destroyAllFonts(), destroyFont(), CEGUI::Scheme::loadResources(), and CEGUI::Scheme::unloadResources().

Font * CEGUI::FontManager::getFont const String name  )  const
 

Returns a pointer to the font object with the specified name.

Parameters:
name String object containing the name of the Font object to be returned
Returns:
Pointer to the requested Font object
Exceptions:
UnknownObjectException Thrown if no font with the given name exists.

Definition at line 183 of file CEGUIFontManager.cpp.

FontManager::FontIterator CEGUI::FontManager::getIterator void   )  const
 

Return a FontManager::FontIterator object to iterate over the available Font objects.

Definition at line 229 of file CEGUIFontManager.cpp.

References FontIterator.

FontManager & CEGUI::FontManager::getSingleton void   )  [static]
 

Return singleton FontManager object.

Returns:
Singleton FontManager object

Reimplemented from CEGUI::Singleton< FontManager >.

Definition at line 213 of file CEGUIFontManager.cpp.

FontManager * CEGUI::FontManager::getSingletonPtr void   )  [static]
 

Return pointer to singleton FontManager object.

Returns:
Pointer to singleton FontManager object

Reimplemented from CEGUI::Singleton< FontManager >.

Definition at line 219 of file CEGUIFontManager.cpp.

bool CEGUI::FontManager::isFontPresent const String name  )  const
 

Checks the existence of a given font.

Parameters:
name String object holding the name of the Font object to look for.
Returns:
true if a Font object named name exists in the system, false if no such font exists.

Definition at line 174 of file CEGUIFontManager.cpp.

Referenced by createFont(), CEGUI::Scheme::loadResources(), and CEGUI::Scheme::resourcesLoaded().

void CEGUI::FontManager::notifyScreenResolution const Size size  ) 
 

Notify the FontManager of the current (usually new) display resolution.

Parameters:
size Size object describing the display resolution
Returns:
Nothing

Definition at line 200 of file CEGUIFontManager.cpp.

References CEGUI::Font::notifyScreenResolution().


Member Data Documentation

FontManager * CEGUI::Singleton< FontManager >::ms_Singleton = NULL [static, protected, inherited]
 

Definition at line 44 of file CEGUIFontManager.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Feb 16 12:41:10 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1