GL Studio C++ Runtime API
GlsRuntimeFontBase Class Reference

#include <gls_runtime_font_base.h>

Inheritance diagram for GlsRuntimeFontBase:
GlsFontBase

Public Types

typedef GlsFontBase::FontAttr_t FontAttrRuntime_t
 Attributes of the specific font.
 
typedef GlsFontBase::CharAttr_t CharAttrRuntime_t
 Character attributes. One item for each character in the set.
 

Public Member Functions

 GlsRuntimeFontBase (const char *family, const char *style, const unsigned int ptSize, const char *fontPath, const unsigned int maxCharWidth, const unsigned int maxCharHeight, const unsigned int descender)
 
bool IsValid (void) const
 
const CharAttrRuntime_tCharAttrRuntime (Char_t c) const
 
RuntimeGlyphGenerationFont * GetRuntimeGlyphGenerationFont ()
 
- 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

 ~GlsRuntimeFontBase ()
 
- Protected Member Functions inherited from GlsFontBase
 ~GlsFontBase ()
 

Protected Attributes

FontAttrRuntime_t _fontAttrRuntime
 
CharAttrRuntime_t _charAttrRuntime
 
bool _isValid
 
ScopedPtr< RuntimeGlyphGenerationFont > _runtimeGlyphGenerationFont
 
- 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 GlsRuntimeFontBase class provides a specific 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 singleton 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

GlsRuntimeFontBase ( const char *  family,
const char *  style,
const unsigned int  ptSize,
const char *  fontPath,
const unsigned int  maxCharWidth,
const unsigned int  maxCharHeight,
const unsigned int  descender 
)

Class Constructor

Parameters
familythe family name of the font.
stylethe style name of the font.
ptSizethe point size of the font.
fontPaththe path and filename of the font file to load.
maxCharWidththe maximum width of the largest character.
maxCharHeightthe maximum height of the largest character.
descenderthe maximum descender of the largest character.
~GlsRuntimeFontBase ( )
protected

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

Member Function Documentation

const CharAttrRuntime_t& CharAttrRuntime ( Char_t  c) const

Gets the runtime 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
RuntimeGlyphGenerationFont* GetRuntimeGlyphGenerationFont ( )

Gets a pointer to the internal data needed for runtime glyph generation.

Returns
A pointer to the internal data needed for runtime glyph generation.
bool IsValid ( void  ) const

Determine if font was instantiated correctly

Returns
true if valid else false

Member Data Documentation

CharAttrRuntime_t _charAttrRuntime
mutableprotected

runtime char attributes

FontAttrRuntime_t _fontAttrRuntime
protected

runtime font attributes

bool _isValid
protected

true if font is valid else false

ScopedPtr<RuntimeGlyphGenerationFont> _runtimeGlyphGenerationFont
protected

Pointer to the internal data needed for runtime glyph generation.

const unsigned short NO_GLYPH
static

char index associated with absent glyph


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