Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CFontCache Class Reference

Font cache. More...

#include <gdi.h>

Inheritance diagram for CFontCache:
CBase

Public Member Functions

IMPORT_C CFontCache ()
 Default constructor.
 
IMPORT_C CFontCache (TInt aMaxEntries)
 Constructor specifying the number of cache entries.
 
IMPORT_C ~CFontCache ()
 Destructor.
 
IMPORT_C CFont * Search (const TFontSpec &aFontSpec)
 Searches the cache for a specified font.
 
IMPORT_C CFont * AddEntryL (CFont *aFont, const TFontSpec &aFontSpec)
 Adds a font entry to the cache.
 
IMPORT_C CFont * RemoveFirstEntry ()
 Removes the first entry from the font cache and returns it.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Public Attributes

TInt iNumHits
 The number of cache hits since the font cache was created i.e.
 
TInt iNumMisses
 The number of cache misses since the font cache was created i.e.
 

Additional Inherited Members

- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 
- Protected Member Functions inherited from CBase
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

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.

API status
Published to all clients. Released API.

Definition at line 1021 of file gdi.h.

Constructor & Destructor Documentation

◆ CFontCache() [1/2]

IMPORT_C CFontCache::CFontCache ( )

Default constructor.

This constructs a CFontCache of size KMaxFontCacheEntries.

(generated from Symbian Developer Library)

◆ CFontCache() [2/2]

IMPORT_C CFontCache::CFontCache ( TInt  aMaxEntries)

Constructor specifying the number of cache entries.

Parameters
aMaxEntriesNumber of entries for this cache. You must ensure this is less than or equal to KMaxFontCacheEntries.

(generated from Symbian Developer Library)

◆ ~CFontCache()

IMPORT_C CFontCache::~CFontCache ( )

Destructor.

This destroys the cashe and releases its allocated memory.

(generated from Symbian Developer Library)

Member Function Documentation

◆ AddEntryL()

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

Adds a font entry to the cache.

The font, and the font specification required to extract it from the cache, are both specified. If the cache is already full, the font replaces the oldest entry already in the cache, which is returned.

Parameters
aFontThe font to be stored in the cache.
aFontSpecThe font's corresponding font specification.

(generated from Symbian Developer Library)

◆ RemoveFirstEntry()

IMPORT_C CFont * CFontCache::RemoveFirstEntry ( )

Removes the first entry from the font cache and returns it.

(generated from Symbian Developer Library)

◆ Search()

IMPORT_C CFont * CFontCache::Search ( const TFontSpec &  aFontSpec)

Searches the cache for a specified font.

The CFont returned is that which corresponds to the font specification aFontSpec.

Parameters
aFontSpecThe specification of the font to be searched for.

(generated from Symbian Developer Library)

Member Data Documentation

◆ iNumHits

TInt CFontCache::iNumHits

The number of cache hits since the font cache was created i.e.

successful results from CFontCache::Search().

Definition at line 1033 of file gdi.h.

◆ iNumMisses

TInt CFontCache::iNumMisses

The number of cache misses since the font cache was created i.e.

unsuccessful results from CFontCache::Search().

Definition at line 1036 of file gdi.h.


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