|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
Font cache. More...
#include <gdi.h>
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. | |
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.
| IMPORT_C CFontCache::CFontCache | ( | ) |
Default constructor.
This constructs a CFontCache of size KMaxFontCacheEntries.
(generated from Symbian Developer Library)
| IMPORT_C CFontCache::CFontCache | ( | TInt | aMaxEntries | ) |
Constructor specifying the number of cache entries.
| aMaxEntries | Number of entries for this cache. You must ensure this is less than or equal to KMaxFontCacheEntries. |
(generated from Symbian Developer Library)
| IMPORT_C CFontCache::~CFontCache | ( | ) |
Destructor.
This destroys the cashe and releases its allocated memory.
(generated from Symbian Developer Library)
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.
| aFont | The font to be stored in the cache. |
| aFontSpec | The font's corresponding font specification. |
(generated from Symbian Developer Library)
| IMPORT_C CFont * CFontCache::RemoveFirstEntry | ( | ) |
Removes the first entry from the font cache and returns it.
(generated from Symbian Developer Library)
Searches the cache for a specified font.
The CFont returned is that which corresponds to the font specification aFontSpec.
| aFontSpec | The specification of the font to be searched for. |
(generated from Symbian Developer Library)
| TInt CFontCache::iNumHits |
The number of cache hits since the font cache was created i.e.
successful results from CFontCache::Search().
| TInt CFontCache::iNumMisses |
The number of cache misses since the font cache was created i.e.
unsuccessful results from CFontCache::Search().