CFontCache Class Reference

#include <textbase.h>

class CFontCache : public CBase

Inherits from

Detailed Description

Font cache.

When a CFont* needs to be found for a particular TFontSpec, the cache can be searched to see if the TFontSpec is already in the cache. If the TFontSpec is in the cache, its corresponding CFont* can be returned. Otherwise GetNearestFontInTwips() must be used to search all of the available fonts for the nearest CFont- a procedure which takes much longer than a simple cache search.

The current font cache should be destroyed and a new cache created whenever the zoom factor or device map changes, as these changes break the relation between CFont and TFontSpec.

Member Attribute Documentation

iNumHits

TInt iNumHits

The number of cache hits since the font cache was created i.e. successful results from CFontCache::Search().

iNumMisses

TInt iNumMisses

The number of cache misses since the font cache was created i.e. unsuccessful results from CFontCache::Search().

Constructor & Destructor Documentation

CFontCache ( )

IMPORT_CCFontCache()

CFontCache ( TInt )

IMPORT_CCFontCache(TIntaMaxEntries)

~CFontCache ( )

IMPORT_C~CFontCache()

Member Function Documentation

AddEntryL ( CFont *, const TFontSpec & )

IMPORT_C CFont *AddEntryL(CFont *aFont,
const TFontSpec &aFontSpec
)

RemoveFirstEntry ( )

IMPORT_C CFont *RemoveFirstEntry()

Search ( const TFontSpec & )

IMPORT_C CFont *Search(const TFontSpec &aFontSpec)