| GL Studio C++ Runtime API

Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
GlsFontMan Class Reference

`#include <gls_font_man.h>`

## Public Member Functions
| ~GlsFontMan ()
GlsFontBase * | Font (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 GlsFontMan & | Instance ()

## Friends
class | GlsGlobals

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ ~GlsFontMan()

~GlsFontMan | ( |  | ) |

Class Destructor.

## Member Function Documentation

## ◆ Font()

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

Retrieve the specified font object.

Parameters

  name | font family name, eg. Arial
  style | font style, eg. Bold
  ptSize | point size

Returns
  a pointer to the font object, or 0 if the font has not been registered with the factory.

## ◆ Instance()

static GlsFontMan & Instance | ( |  | ) |
| static

Returns
  A reference to the singleton factory object.

## ◆ Register()

void Register | ( | GlsFontBase * | font | ) |

Register the specified font object.

Parameters

  font | font object

## ◆ Release()

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

  font | font object

## ◆ Use()

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

  font | font object

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

- gls_font_man.h