My Project
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
ParaEngine::FontAtlas Class Reference
Inheritance diagram for ParaEngine::FontAtlas:
ParaEngine::CRefCountedOne ParaEngine::CRefCounted

Public Member Functions

 FontAtlas (Font &theFont)
 
void addLetterDefinition (char16_t utf16Char, const FontLetterDefinition &letterDefinition)
 
bool getLetterDefinitionForChar (char16_t utf16Char, FontLetterDefinition &letterDefinition)
 
bool prepareLetterDefinitions (const std::u16string &utf16String)
 
const std::unordered_map< size_t, Texture2D * > & getTextures () const
 
void addTexture (Texture2D *texture, int slot)
 
float getLineHeight () const
 
void setLineHeight (float newHeight)
 
Texture2DgetTexture (int slot)
 
const FontgetFont () const
 
float getCommonLineHeight () const
 
void purgeTexturesAtlas ()
 Removes textures atlas. More...
 
void setAntiAliasTexParameters ()
 sets font texture parameters: More...
 
void setAliasTexParameters ()
 sets font texture parameters: More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Static Public Attributes

static const int CacheTextureWidth = 512
 
static const int CacheTextureHeight = 512
 
static const char * CMD_PURGE_FONTATLAS = "__cc_PURGE_FONTATLAS"
 
static const char * CMD_RESET_FONTATLAS = "__cc_RESET_FONTATLAS"
 

Protected Member Functions

void reset ()
 
void releaseTextures ()
 
void findNewCharacters (const std::u16string &u16Text, std::unordered_map< unsigned short, unsigned short > &charCodeMap)
 
void conversionU16TOGB2312 (const std::u16string &u16Text, std::unordered_map< unsigned short, unsigned short > &charCodeMap)
 
void scaleFontLetterDefinition (float scaleFactor)
 Scale each font letter by scaleFactor. More...
 

Protected Attributes

std::unordered_map< size_t, Texture2D * > _atlasTextures
 
std::unordered_map< char16_t, FontLetterDefinition_letterDefinitions
 
float _lineHeight
 
Font_font
 
FontFreeType_fontFreeType
 
void * _iconv
 
int _currentPage
 
unsigned char * _currentPageData
 
int _currentPageDataSize
 
float _currentPageOrigX
 
float _currentPageOrigY
 
int _letterPadding
 
int _letterEdgeExtend
 
int _fontAscender
 
bool _antialiasEnabled
 
int _currLineHeight
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Friends

class Label
 

Member Function Documentation

§ purgeTexturesAtlas()

void FontAtlas::purgeTexturesAtlas ( )

Removes textures atlas.

It will purge the textures atlas and if multiple texture exist in the FontAtlas.

§ scaleFontLetterDefinition()

void FontAtlas::scaleFontLetterDefinition ( float  scaleFactor)
protected

Scale each font letter by scaleFactor.

Parameters
scaleFactorA float scale factor for scaling font letter info.

§ setAliasTexParameters()

void FontAtlas::setAliasTexParameters ( )

sets font texture parameters:

  • GL_TEXTURE_MIN_FILTER = GL_NEAREST
  • GL_TEXTURE_MAG_FILTER = GL_NEAREST

§ setAntiAliasTexParameters()

void FontAtlas::setAntiAliasTexParameters ( )

sets font texture parameters:

  • GL_TEXTURE_MIN_FILTER = GL_LINEAR
  • GL_TEXTURE_MAG_FILTER = GL_LINEAR

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