Guiliani  Version 2.5 revision 7293 (documentation build 13)
CFntWrapGLFontAtlas Class Referenceabstract

#include <FntWrapGLFontAtlas.h>

Inheritance diagram for CFntWrapGLFontAtlas:

Classes

struct  FontAtlasRecord_t
 Struct representing one character inside the cache array. More...
 

Public Member Functions

 CFntWrapGLFontAtlas (const FontResource_t &reFontID, const eC_UInt &uiNumberOfRows)
 
virtual ~CFntWrapGLFontAtlas ()
 
eC_Int GetAscender () const
 
FontAtlasRecord_t GetChar (const eC_UInt &uiUnicode)
 
eC_Int GetDescender () const
 
virtual void * GetFace ()=0
 
eC_Int GetHeight () const
 
eC_Int GetInternalLeading () const
 
eC_UInt GetTextureHeight () const
 
eC_UInt GetTextureID () const
 
eC_UInt GetTextureWidth () const
 

Protected Member Functions

virtual FontAtlasRecord_t AddGlyph (const eC_UInt &uiUnicode)=0
 
eC_UInt CreateTexture (const eC_Int &iTextureWidth, const eC_Int &iTextureHeight, const eC_UInt &uiLastTextureID=0)
 
void DeleteTexture (const eC_UInt &uiTextureID)
 
eC_UInt InsertGlyphInformation (const eC_UInt &uiUnicode, const eC_UInt &uiWidth, const eC_Int &iGlyphXPos, const eC_Int &iGlyphYPos, const eC_Int &iGlyphWidth, const eC_Int &iGlyphHeight, const eC_UInt &uiXPos, const eC_UInt &uiYPos)
 

Protected Attributes

eC_TArray< FontAtlasRecord_tm_asGlyphCache
 The dynamic cache array.
 
eC_Bool m_bArrayNeedsSorting
 Flag indicating that the internal array of stored characters needs to be sorted.
 
FontResource_t m_eFontID
 id of loaded font
 
eC_Int m_iAscender
 ascender
 
eC_Int m_iDescender
 descender
 
eC_Int m_iFontHeight
 height of font
 
eC_Int m_iFontWidth
 width of font
 
eC_Int m_iInternalLeading
 internal leading
 
eC_UInt m_uiCurrentFillRow
 current row for new characters
 
eC_UInt m_uiNumberOfCachedGlyphs
 number of cached glyphs
 
eC_UInt m_uiRemainingSpace
 remaining pixels of storage for current row
 
eC_UInt m_uiTextureHeight
 height of generated texture
 
eC_UInt m_uiTextureID
 texture-id for the atlas
 
eC_UInt m_uiTextureWidth
 width of generated texture
 
eC_UInt m_uiTotalNumberOfRows
 number of rows which can be used for storage
 

Detailed Description

This class is used by FntWrapFreeTypeGL. It stores the texture-atlas information for one Font.

Constructor & Destructor Documentation

◆ CFntWrapGLFontAtlas()

CFntWrapGLFontAtlas::CFntWrapGLFontAtlas ( const FontResource_t reFontID,
const eC_UInt &  uiNumberOfRows 
)

Constructor

Parameters
reFontIDID of selected font.
uiNumberOfRowsInitial number of rows for the texture atlas.

◆ ~CFntWrapGLFontAtlas()

virtual CFntWrapGLFontAtlas::~CFntWrapGLFontAtlas ( )
virtual

Destructor

Member Function Documentation

◆ AddGlyph()

virtual FontAtlasRecord_t CFntWrapGLFontAtlas::AddGlyph ( const eC_UInt &  uiUnicode)
protectedpure virtual

Adds a character to the cache array and sorts array afterwards.

Parameters
uiUnicodeUnicode to add to array.
Returns
Struct of just added character.

Implemented in CFntWrapFreeTypeGLFontAtlas, and CFntWrapGlyphLibGLFontAtlas.

◆ CreateTexture()

eC_UInt CFntWrapGLFontAtlas::CreateTexture ( const eC_Int &  iTextureWidth,
const eC_Int &  iTextureHeight,
const eC_UInt &  uiLastTextureID = 0 
)
protected

create a texture with the given dimensions

Parameters
iTextureWidthwidth
iTextureHeightheight
uiLastTextureIDID of last generated texture for font
Returns
id of the new texture

◆ DeleteTexture()

void CFntWrapGLFontAtlas::DeleteTexture ( const eC_UInt &  uiTextureID)
protected

delete the texture

Parameters
uiTextureID

◆ GetAscender()

eC_Int CFntWrapGLFontAtlas::GetAscender ( ) const
inline

Returns the ascender of the current font.

Returns
Font's ascender.

◆ GetChar()

FontAtlasRecord_t CFntWrapGLFontAtlas::GetChar ( const eC_UInt &  uiUnicode)

This method returns a struct with the wanted character's information. It adds a character to the cache array if it does not exist.

Parameters
uiUnicodeUnicode of wanted character.
Returns
Struct of wanted character.

◆ GetDescender()

eC_Int CFntWrapGLFontAtlas::GetDescender ( ) const
inline

Returns the descender of the current font.

Returns
Font's descender.

◆ GetFace()

virtual void * CFntWrapGLFontAtlas::GetFace ( )
pure virtual

return the current face

Returns
face

Implemented in CFntWrapFreeTypeGLFontAtlas, and CFntWrapGlyphLibGLFontAtlas.

◆ GetHeight()

eC_Int CFntWrapGLFontAtlas::GetHeight ( ) const
inline

Returns the height of current font.

Returns
Font's height.

◆ GetInternalLeading()

eC_Int CFntWrapGLFontAtlas::GetInternalLeading ( ) const
inline

Returns the internal leading of the current font.

Returns
Font's internal leading.

◆ GetTextureHeight()

eC_UInt CFntWrapGLFontAtlas::GetTextureHeight ( ) const
inline

Return the height of the used texture

Returns
height of texture

◆ GetTextureID()

eC_UInt CFntWrapGLFontAtlas::GetTextureID ( ) const
inline

Returns the internal ID for the used texture

Returns
texture-id

◆ GetTextureWidth()

eC_UInt CFntWrapGLFontAtlas::GetTextureWidth ( ) const
inline

Return the width of the used texture

Returns
width of texture

◆ InsertGlyphInformation()

eC_UInt CFntWrapGLFontAtlas::InsertGlyphInformation ( const eC_UInt &  uiUnicode,
const eC_UInt &  uiWidth,
const eC_Int &  iGlyphXPos,
const eC_Int &  iGlyphYPos,
const eC_Int &  iGlyphWidth,
const eC_Int &  iGlyphHeight,
const eC_UInt &  uiXPos,
const eC_UInt &  uiYPos 
)
protected

add the information for a new glyph

Parameters
uiUnicodecode-point
uiWidthwidth of glyph
iGlyphXPosx-position
iGlyphYPosy-position
iGlyphWidthwidth
iGlyphHeightheight
uiXPosx-position inside texture
uiYPosy-position inside texture
Returns
index of the new glyph

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