#include <FntWrapGLFontAtlas.h>
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_t > | m_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 | |
This class is used by FntWrapFreeTypeGL. It stores the texture-atlas information for one Font.
CFntWrapGLFontAtlas::CFntWrapGLFontAtlas | ( | const FontResource_t & | reFontID, |
const eC_UInt & | uiNumberOfRows | ||
) |
Constructor
reFontID | ID of selected font. |
uiNumberOfRows | Initial number of rows for the texture atlas. |
|
virtual |
Destructor
|
protectedpure virtual |
Adds a character to the cache array and sorts array afterwards.
uiUnicode | Unicode to add to array. |
Implemented in CFntWrapFreeTypeGLFontAtlas, and CFntWrapGlyphLibGLFontAtlas.
|
protected |
create a texture with the given dimensions
iTextureWidth | width |
iTextureHeight | height |
uiLastTextureID | ID of last generated texture for font |
|
protected |
delete the texture
uiTextureID |
|
inline |
Returns the ascender of the current font.
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.
uiUnicode | Unicode of wanted character. |
|
inline |
Returns the descender of the current font.
|
pure virtual |
return the current face
Implemented in CFntWrapFreeTypeGLFontAtlas, and CFntWrapGlyphLibGLFontAtlas.
|
inline |
Returns the height of current font.
|
inline |
Returns the internal leading of the current font.
|
inline |
Return the height of the used texture
|
inline |
Returns the internal ID for the used texture
|
inline |
Return the width of the used texture
|
protected |
add the information for a new glyph
uiUnicode | code-point |
uiWidth | width of glyph |
iGlyphXPos | x-position |
iGlyphYPos | y-position |
iGlyphWidth | width |
iGlyphHeight | height |
uiXPos | x-position inside texture |
uiYPos | y-position inside texture |