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

FontCache is the base-class for glyph-cache. More...

#include <FontCache.h>

Inheritance diagram for CFontCache:

Classes

struct  CachedChar_t
 struct for holding the unicode and a pointer to the related info-block More...
 
struct  CachedCharInfo_t
 

Public Member Functions

 CFontCache (const FontResource_t &eFontID, const eC_UInt &uiInitialCacheSize, const eC_Bool &bAutoResize, const eC_UInt &uiResizeBy)
 
virtual ~CFontCache ()
 
eC_Int GetAscender () const
 
CachedChar_t GetChar (const eC_UInt &uiUnicode)
 
eC_Int GetDescender () const
 
void * GetFace ()
 
eC_Int GetHeight () const
 
eC_Int GetInternalLeading () const
 

Protected Member Functions

 CFontCache (const CFontCache &kSource)
 
virtual CachedChar_t AddChar (const eC_UInt &uiUnicode, const eC_UInt &uiPos)=0
 
eC_Int FindChar (const eC_UInt &uiUnicode)
 
eC_UInt FindLowestTimestampPos ()
 
CFontCacheoperator= (const CFontCache &kSource)
 
virtual void RemoveChar (const eC_UInt &uiPos)
 
void Sort ()
 
void Swap (CachedChar_t *pPosA, CachedChar_t *pPosB)
 

Protected Attributes

eC_TArray< CachedChar_tm_asCache
 The dynamic cache array.
 
eC_Bool m_bArrayNeedsSorting
 sorting needed after modification
 
eC_Bool m_bAutoResize
 auto-resize
 
eC_Bool m_bUseTimeStamp
 timestamp
 
FontResource_t m_eFontID
 loaded font
 
eC_Int m_iAscender
 ascender
 
eC_Int m_iDescender
 descender
 
eC_Int m_iHeight
 height of font
 
eC_Int m_iInternalLeading
 internal leading
 
void * m_pkFace
 face of font
 
eC_UInt m_uiNextGlyphIndex
 index of next glyph
 
eC_UInt m_uiResizeBy
 resize by amount
 
eC_UInt m_uiTimer
 current timer
 

Detailed Description

FontCache is the base-class for glyph-cache.

It stores the cache information for one Font.

Constructor & Destructor Documentation

◆ CFontCache() [1/2]

CFontCache::CFontCache ( const FontResource_t eFontID,
const eC_UInt &  uiInitialCacheSize,
const eC_Bool &  bAutoResize,
const eC_UInt &  uiResizeBy 
)

Constructor

Parameters
eFontIDID of selected font.
uiInitialCacheSizeinitial number of simultaneously cached characters. If parameter equals zero the cache will automatically be resized to be large enough to contain all required characters.
bAutoResizeif true the cache gets resized if not big enough to hold new entries
uiResizeBynumber of elements which are added on resize

◆ ~CFontCache()

virtual CFontCache::~CFontCache ( )
virtual

Destructor

◆ CFontCache() [2/2]

CFontCache::CFontCache ( const CFontCache kSource)
protected

Copy-constructor. Dummy implementation to avoid unintended use of compiler-generated default

Parameters
kSource

Member Function Documentation

◆ AddChar()

virtual CachedChar_t CFontCache::AddChar ( const eC_UInt &  uiUnicode,
const eC_UInt &  uiPos 
)
protectedpure virtual

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

Parameters
uiUnicodeUnicode to add to array.
uiPosPosition in array where the character should be added.
Returns
Struct of added character.

Implemented in CFontCacheFreeType, and CFontCacheGlyphLib.

◆ FindChar()

eC_Int CFontCache::FindChar ( const eC_UInt &  uiUnicode)
protected

Searches for a character inside the cache array by using divide and conquer.

Parameters
uiUnicodeCharacter to search for.
Returns
Position in array of -1 if not found.

◆ FindLowestTimestampPos()

eC_UInt CFontCache::FindLowestTimestampPos ( )
protected

Searches the list for the lowest timestamp and return that position.

Returns
Lowest timestamp position in array.

◆ GetAscender()

eC_Int CFontCache::GetAscender ( ) const
inline

Returns the ascender of the current font.

Returns
Font's ascender.

◆ GetChar()

CachedChar_t CFontCache::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 CFontCache::GetDescender ( ) const
inline

Returns the descender of the current font.

Returns
Font's descender.

◆ GetFace()

void * CFontCache::GetFace ( )
inline

get internal face from font

Returns
face

◆ GetHeight()

eC_Int CFontCache::GetHeight ( ) const
inline

Returns the height of current font.

Returns
Font's height.

◆ GetInternalLeading()

eC_Int CFontCache::GetInternalLeading ( ) const
inline

Returns the internal leading of the current font.

Returns
Font's internal leading.

◆ operator=()

CFontCache & CFontCache::operator= ( const CFontCache kSource)
protected

Operator= method. Dummy implementation to avoid unintended use of compiler-generated default

Parameters
kSource
Returns

◆ RemoveChar()

virtual void CFontCache::RemoveChar ( const eC_UInt &  uiPos)
protectedvirtual

Removes a character from array.

Parameters
uiPosPosition of the character to remove.

◆ Sort()

void CFontCache::Sort ( )
protected

Sorts the cache list by unicode in ascending order using bubble sort algorithm.

◆ Swap()

void CFontCache::Swap ( CachedChar_t pPosA,
CachedChar_t pPosB 
)
protected

Swaps two given values.

Parameters
pPosAPointer of the first value.
pPosBPointer of the second value.

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