A font that can be used to display text. Characters can be accessed through a single texture atlas. More...

#include <Font.h>

Public Member Functions

 Font ()
 Constructor. More...
 
 Font (const std::string &fontFileName, GLuint fontPixelSize)
 Constructor. More...
 
virtual ~Font ()
 Virtual destructor. More...
 
virtual void loadFont (const std::string &fontFileName)
 Loads a font file. More...
 
virtual void setPixelSize (GLuint fontPixelSize)
 Set the nominal font size in pixels (the characters may vary in size) More...
 
GLuint getPixelSize ()
 Returns the nominal font size in pixels (the characters may vary in size) More...
 
const std::string & getFontFileName ()
 Returns the file name of the current font (including extension) More...
 
virtual ftgl::texture_glyph_t * getCharacter (char c)
 Returns a character. More...
 
TexturePtr getAtlas ()
 Returns the character atlas. More...
 
virtual void deleteFont ()
 Delete the font and its texture atlas. More...
 

Detailed Description

A font that can be used to display text. Characters can be accessed through a single texture atlas.

Author
Benjamin Buergisser

Constructor & Destructor Documentation

Font::Font ( )
inline

Constructor.

Font::Font ( const std::string &  fontFileName,
GLuint  fontPixelSize 
)

Constructor.

Parameters
[in]fileNameFile name including extension
[in]fontPixelSizeThe nominal font size in pixels (the characters may vary in size)
virtual Font::~Font ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

void Font::deleteFont ( )
virtual

Delete the font and its texture atlas.

TexturePtr Font::getAtlas ( )
inline

Returns the character atlas.

ftgl::texture_glyph_t * Font::getCharacter ( char  c)
virtual

Returns a character.

Parameters
[in]cThe character to get
const std::string& Font::getFontFileName ( )
inline

Returns the file name of the current font (including extension)

GLuint Font::getPixelSize ( )
inline

Returns the nominal font size in pixels (the characters may vary in size)

virtual void Font::loadFont ( const std::string &  fontFileName)
inlinevirtual

Loads a font file.

Parameters
[in]fileNameFile name including extension
virtual void Font::setPixelSize ( GLuint  fontPixelSize)
inlinevirtual

Set the nominal font size in pixels (the characters may vary in size)

Parameters
[in]fontPixelSizeThe nominal font size in pixels