Location:
GDI.H
Link against: gdi.lib
class CTypefaceStore : public CBase;
Typeface store abstract base interface.
This class provides the interface to a store for typefaces.
See also CFontStore.
CBase
- Base class for all classes to be instantiated on the heap
CTypefaceStore
- Typeface store abstract base interface
Defined in CTypefaceStore
:
AddFontL()
, BaselineOffset()
, CTypefaceStore()
, ConstructL()
, FontHeightInTwips()
, GetNearestFontInTwips()
, GetNearestFontToDesignHeightInTwips()
, GetNearestFontToMaxHeightInTwips()
, IncrementFontCount()
, NumTypefaces()
, ReleaseFont()
, SuperSubHeight()
, TypefaceSupport()
, iFontAccess
, ~CTypefaceStore()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
IMPORT_C ~CTypefaceStore();
Destroys the typeface store and reclaims the memory allocated to it.
virtual TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec &aFontSpec)=0;
Gets the font which is the nearest to the given font specification.
|
|
virtual TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec)=0;
Gets the font which is the nearest to the given font specification. Matching to design height gives no guarantees on the actual physical size of the font.
|
|
virtual TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight)=0;
Gets the font which is the nearest to the given font specification. Matching to design height gives no guarantees on the actual physical size of the font.
|
|
virtual TInt NumTypefaces() const=0;
Gets the number of typefaces supported by the typeface store.
|
virtual void TypefaceSupport(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const=0;
Gets typeface information for a specified typeface index.
This information is returned in aTypefaceSupport, and includes the typeface name and typeface attributes, the number of font heights, the maximum and minimum font heights, and whether it is a scaleable typeface.
|
virtual TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const=0;
Gets the height of the font with specified height and typeface indices, in twips.
The value returned is rounded up or down to the nearest font height in twips.
|
|
IMPORT_C void ReleaseFont(CFont *aFont);
Releases the hold of a typeface store client on a specified font.
Decrements the access-count for the specified font by one. If this reduces the access-count to zero then the font is no longer needed by any client, and is deleted from the typeface store list.
|
static IMPORT_C TInt BaselineOffset(TInt aHeight, TFontPrintPosition aPos);
Gets the baseline offset, in twips, for any font in subscript or superscript form.
If the print position is normal then zero is returned. If it is superscript then the baseline offset returned is a percentage, KSuperscriptOffsetPercentage, of aHeight. If it is subscript then the baseline offset returned is a percentage, KSubscriptOffsetPercentage, of aHeight.
|
|
static IMPORT_C TInt SuperSubHeight(TInt aHeight, TFontPrintPosition aPos);
Gets the height for a font in subscript or superscript form.
If the print position is normal then aHeight is returned unchanged. If it is superscript or subscript then the height returned is a percentage, KSuperSubScalingPercentage, of aHeight.
|
|
protected: IMPORT_C void AddFontL(CFont *aFont);
Adds a hold, by a client of the typeface store, on the specified font.
If the specified font is not currently accessed by any clients of the typeface store then the font is added to the font list and the access count set to 1. If it is currently accessed then the access count for the font is incremented by 1.
|
protected: IMPORT_C TBool IncrementFontCount(const CFont *aFont);
Search for the font in iFontAccess and increment its count.
|
|
protected: CArrayFixFlat< TFontAccess > * iFontAccess;
A list of fonts accessed by clients of the typeface store, which pairs a font with a count of the number of clients accessing the font.
Implemented as an array of TFontAccess
objects.
An object is added to this array for every font accessed. If the font is released by all clients, and the access count drops to zero, the font is removed from the list.