GL Studio C++ Runtime API
GlsFontMan Class Reference

#include <gls_font_man.h>

Public Member Functions

 ~GlsFontMan ()
 
GlsFontBaseFont (const std::string &name, const std::string &style, GLuint ptSize) const
 
void Register (GlsFontBase *font)
 
void Use (GlsFontBase *font)
 
void Release (GlsFontBase *font)
 

Static Public Member Functions

static GlsFontManInstance ()
 

Detailed Description

The GlsFontMan class provides a manager singleton for registering and retrieving fonts.

Constructor & Destructor Documentation

~GlsFontMan ( )

Class Destructor.

Member Function Documentation

GlsFontBase* Font ( const std::string &  name,
const std::string &  style,
GLuint  ptSize 
) const

Retrieve the specified font object.

Parameters
namefont family name, eg. Arial
stylefont style, eg. Bold
ptSizepoint size
Returns
a pointer to the font object, or 0 if the font has not been registered with the factory.
static GlsFontMan& Instance ( )
static

Provides access to the singleton factory object.

void Register ( GlsFontBase font)

Register the specified font object.

Parameters
fontfont object
void Release ( GlsFontBase font)

Notify the font manager that the particular font is no longer being used by the caller so that its reference count can be managed. The font's reference count will be decremented by 1 and if there are no longer any users, the font object will be deleted. Only use Release subsequent to using the Use call or the reference counting will not work.

Parameters
fontfont object
void Use ( GlsFontBase font)

Notify the font manager that the particular font is being used so that its reference count can be managed. If the font is not already being managed, it will be added to the manager's font repository first. The font's reference count will be incremented by 1. The Use and Release reference counting methods are separate from the Font and Register methods so that reference counting of fonts can be optional. For example, reference counting may be necessary in the GL Studio editor but not desired at run-time.

Parameters
fontfont object

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