Font Class Reference

Texture based font for the GUI. More...

#include <Font.h>

List of all members.

Public Member Functions

 Font ()
 Standard Constructor.
 Font (const string &filename)
 Constructor.
 Font (const Font &source)
 Copy-constructor.
 ~Font ()
 Destructor.
string & getFontname ()
 Gets texture filename.
TexturegetStandardTexture ()
 Gets standard styled font texture.
TexturegetBoldTexture ()
 Gets bold styled font texture.
GLfloat printCharGl (const unsigned char &character, const bool &bold, const GLfloat &size)
 Generates a single Quad with a font character.
float getLength (const string &text)
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.
Font operator= (const Font &font)
 Operator =.

Private Attributes

string fontname
struct fontCoordssCoords
struct fontCoordsbCoords

Static Private Attributes

static FontManagerfontMan = FontManager::getInstance()


Detailed Description

Texture based font for the GUI.

Provides font support for ASCII and Windows-1252 character strings.


Constructor & Destructor Documentation

Font::Font (  ) 

Standard Constructor.

Font::Font ( const string &  fontname  ) 

Constructor.

If an invalid fontname was choosen, a default font will be generated

Parameters:
fontname The font to be loaded

Font::Font ( const Font source  ) 

Copy-constructor.

Duplicates a font

Font::~Font (  ) 

Destructor.

Destroys the font.


Member Function Documentation

string & Font::getFontname (  ) 

Gets texture filename.

Returns:
The texture's image filename

Texture * Font::getStandardTexture (  ) 

Gets standard styled font texture.

Returns:
The texture ths font uses for the standard style

Texture * Font::getBoldTexture (  ) 

Gets bold styled font texture.

Returns:
The texture ths font uses for the bold style

GLfloat Font::printCharGl ( const unsigned char &  character,
const bool &  bold,
const GLfloat &  size 
)

Generates a single Quad with a font character.

Prints a single character to an OpenGL quad. It is assumed, that texturing and blending are enabled and the Modelview matrix is set in such a manner, that the character shall be written top right starting at the origin.

Parameters:
character The character to be written
bold If true, the bold styled texture will be used
size The line height in which to fit the character in world units
Returns:
The width of the printed character including a standard letter distance margin.

float Font::getLength ( const string &  text  ) 

string Font::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

string Font::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

enum classId Font::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Font Font::operator= ( const Font font  )  [inline]

Operator =.


Member Data Documentation

FontManager * Font::fontMan = FontManager::getInstance() [static, private]

All Font use the same font manager to store their data

string Font::fontname [private]

struct fontCoords* Font::sCoords [read, private]

struct fontCoords* Font::bCoords [read, private]


The documentation for this class was generated from the following files:

Generated on Mon Jul 7 13:30:33 2008 for Firefly by  doxygen 1.5.6