| GL Studio C++ Runtime API

Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
GlsUnicodeFontBase Class Reference

`#include <gls_unicode_font_base.h>`

Inheritance diagram for GlsUnicodeFontBase:

## Classes
struct | CharAttrUnicode_t
| Character attributes. One item for each character in the set. More...
struct | FontAttrUnicode_t
| Attributes of the specific font. More...

## Public Types
typedef std::vector< CharAttrUnicode_t > | AttrContUnicode_t
| Typedef for a list of character attributes.
typedef std::vector< Image * > | ImageVector_t
| Typedef for a list of glyph images.
Public Types inherited from GlsFontBase
typedef GLuint | Char_t
| Define the character type to use.
typedef std::vector< CharAttr_t > | AttrCont_t
| Typedef for a list of character attributes.

## Public Member Functions
| GlsUnicodeFontBase (GlsUnicodeFontDBUFReader &dbufReader)
bool | IsValid () const
ImageVector_t | FontTextures () const
const CharAttrUnicode_t & | CharAttrUnicode (Char_t c) const
Image * | FontTextureForChar (Char_t c) const
Public Member Functions inherited from GlsFontBase
| GlsFontBase (const FontAttr_t &fontAttr, const AttrCont_t &charAttributes, Image *texture)
const FontAttr_t & | Attributes () const
const CharAttr_t & | CharAttr (Char_t c) const
GLuint | CharAttrIndex (Char_t c) const
const AttrCont_t & | CharAttributes () const
std::string | Family () const
std::string | Key () const
GLfloat | MaxCharHeight () const
GLfloat | MaxCharWidth () const
GLuint | PtSize () const
std::string | Style () const
Image * | Texture () const

## Static Public Attributes
static const unsigned short | NO_GLYPH

## Protected Member Functions
| ~GlsUnicodeFontBase ()
Protected Member Functions inherited from GlsFontBase
| ~GlsFontBase ()

## Protected Attributes
FontAttrUnicode_t | _fontAttrUnicode
AttrContUnicode_t | _charAttrUnicode
ImageVector_t | _fontTextures
bool | _isValid
unsigned int | _charAttributeIndexLUTSize
unsigned short * | _charAttributeIndexLUT
Protected Attributes inherited from GlsFontBase
FontAttr_t | _attr
AttrCont_t | _charAttr
std::string | _key
Image * | _texture

## Friends
class | GlsFontMan

## Additional Inherited Members
Static Public Member Functions inherited from GlsFontBase
static std::string | Key (const std::string &name, const std::string &style, GLuint ptSize)

## Detailed Description

The GlsUnicodeFontBase class provides a specific unicode font face for use within the GL Studio. The font face is determined at construction time by the parameters passed in by the creator of the GlsFontBase instance. Specific instances should be wrapped in a singelton object wrapper, as there is no reason to have more than one instance of the exact same face (meaning font family, style, and point size.)

Once instanced, a GlsFontRenderer object can be used to render characters in Open GL at specific locations and with several different text effects.

See also
  GlsFontRenderer

## Constructor & Destructor Documentation

## ◆ GlsUnicodeFontBase()

GlsUnicodeFontBase | ( | GlsUnicodeFontDBUFReader & | dbufReader | ) |

Class Constructor

Parameters

  dbufReader | reader to read BUF data from

## ◆ ~GlsUnicodeFontBase()

~GlsUnicodeFontBase | ( |  | ) |
| protected

Class Destructor. This is protected so that no one can delete a font except via the font manager GlsFontMan. It is not vitual because we want to avoid calling destructors on unloaded font code, and it is not needed.

## Member Function Documentation

## ◆ CharAttrUnicode()

const CharAttrUnicode_t & CharAttrUnicode | ( | Char_t | c | ) | const

get the unicode character attribute for the given char

Parameters

  c | The character to retrieve attributes for.

Returns
  The attributes for the character else char attributes for first character in font if char is not in range for this font

## ◆ FontTextureForChar()

Image * FontTextureForChar | ( | Char_t | c | ) | const

Get the font texture for the font texture containing the given glyph

Parameters

  c | The character to retrieve attributes for.

Returns
  the font texture for the font texture containing the given glyph, else font texture for first glyph in font if glyph is not in the font

## ◆ FontTextures()

ImageVector_t FontTextures | ( |  | ) | const

get the font textures associated with the unicode font

Returns
  the font textures associated with the unicode font

## ◆ IsValid()

bool IsValid | ( |  | ) | const

Determine if font was instantiated correctly

Returns
  true if valid else false

## Member Data Documentation

## ◆ _charAttributeIndexLUT

unsigned short* _charAttributeIndexLUT
| protected

look up table from glyph index ( minus _fontAttributes.firstChar ) to _charAttrUnicode array index else entry has NO_GLYPH to indicate that the given glyph is not in the font ( NOTE : array is _charAttributeIndexLUT long )

## ◆ _charAttributeIndexLUTSize

unsigned int _charAttributeIndexLUTSize
| protected

number of entries in the _charAttributeIndexLUT = ( lastChar - firstChar ) + 1 )

## ◆ _charAttrUnicode

AttrContUnicode_t _charAttrUnicode
| protected

unicode char attributes

## ◆ _fontAttrUnicode

FontAttrUnicode_t _fontAttrUnicode
| protected

unicode font attributes

## ◆ _fontTextures

ImageVector_t _fontTextures
| protected

font textures

## ◆ _isValid

bool _isValid
| protected

true if font is valid else false

## ◆ NO_GLYPH

const unsigned short NO_GLYPH
| static

char index associated with absent glyph

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

- gls_unicode_font_base.h