GL Studio C++ Runtime API
GlsUnicodeFontBase Class Reference

#include <gls_unicode_font_base.h>

Inheritance diagram for GlsUnicodeFontBase:
GlsFontBase

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 Member Functions

 GlsUnicodeFontBase (GlsUnicodeFontDBUFReader &dbufReader)
 
bool IsValid (void) const
 
ImageVector_t FontTextures (void) const
 
const CharAttrUnicode_tCharAttrUnicode (Char_t c) const
 
ImageFontTextureForChar (Char_t c) const
 
- Public Member Functions inherited from GlsFontBase
 GlsFontBase (const FontAttr_t &fontAttr, const AttrCont_t &charAttributes, Image *texture)
 
const FontAttr_tAttributes () const
 
const CharAttr_tCharAttr (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
 
ImageTexture () 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
 

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

Class Constructor

Parameters
dbufReaderreader to read BUF data from
~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

const CharAttrUnicode_t& CharAttrUnicode ( Char_t  c) const

get the unicode character attribute for the given char

Parameters
cThe 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
Image* FontTextureForChar ( Char_t  c) const

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

Parameters
cThe 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
ImageVector_t FontTextures ( void  ) const

get the font textures associated with the unicode font

Returns
the font textures associated with the unicode font
bool IsValid ( void  ) const

Determine if font was instantiated correctly

Returns
true if valid else false

Member Data Documentation

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 )

unsigned int _charAttributeIndexLUTSize
protected

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

AttrContUnicode_t _charAttrUnicode
protected

unicode char attributes

FontAttrUnicode_t _fontAttrUnicode
protected

unicode font attributes

ImageVector_t _fontTextures
protected

font textures

bool _isValid
protected

true if font is valid else false

const unsigned short NO_GLYPH
static

char index associated with absent glyph


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