CTypefaceStore Class Reference

class CTypefaceStore : public CBase

Typeface store abstract base interface.

This class provides the interface to a store for typefaces.

See also CFontStore.

Inherits from

Nested Classes and Structures

Constructor & Destructor Documentation

CTypefaceStore()

IMPORT_CCTypefaceStore()[protected]

~CTypefaceStore()

IMPORT_C~CTypefaceStore()

Member Functions Documentation

AddFontL(CFont *)

IMPORT_C voidAddFontL(CFont *aFont)[protected]

Parameters

CFont * aFont

BaselineOffset(TInt, TFontPrintPosition)

IMPORT_C TIntBaselineOffset(TIntaHeight,
TFontPrintPositionaPos
)[static]

Parameters

TInt aHeight
TFontPrintPosition aPos

ConstructL()

IMPORT_C voidConstructL()[protected]

FindFont(const CFont *, TInt &)

TBool FindFont(const CFont *aFont,
TInt &aIdx
)const [private]

Parameters

const CFont * aFont
TInt & aIdx

FontHeightInTwips(TInt, TInt)

TInt FontHeightInTwips(TIntaTypefaceIndex,
TIntaHeightIndex
)const [pure virtual]

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.

The height of the font, in twips.

Parameters

TInt aTypefaceIndexA typeface index number, in the range: 0 to (NumTypefaces() - 1).
TInt aHeightIndexA font height index number.

GetNearestFontInTwips(CFont *&, const TFontSpec &)

TInt GetNearestFontInTwips(CFont *&aFont,
const TFontSpec &aFontSpec
)[pure virtual]

Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call ReleaseFont().

Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every character within any given text string will fit within the given amount of twips, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

KErrNone if successful; a system-wide error code otherwise.

Use GetNearestFontToDesignHeightInTwips

Parameters

CFont *& aFontOn return, contains a pointer to the nearest font.
const TFontSpec & aFontSpecThe specification of the font to be matched.

GetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &)

TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont,
const TFontSpec &aFontSpec
)[pure virtual]

Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call ReleaseFont().

This new function replaces the deprecated GetNearestFontInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every character within any given text string will fit within the given amount of twips, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

KErrNone if successful; a system-wide error code otherwise.

Parameters

CFont *& aFontOn return, contains a pointer to the nearest font.
const TFontSpec & aFontSpecThe specification of the font to be matched.

GetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt)

TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont,
const TFontSpec &aFontSpec,
TIntaMaxHeight
)[pure virtual]

Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call ReleaseFont().

The font and bitmap server returns a pointer to the nearest matching font from those available. Matches to max height of font - this does its best to return a font that will fit within the maximum height specified (but note that variations due to hinting algorithms may rarely result in this height being exceeded by up to one pixel). Problems can also be encountered with bitmap fonts where the typeface exists but doesn't have a font small enough.

KErrNone if successful; a system-wide error code otherwise.

Parameters

CFont *& aFontOn return, contains a pointer to the nearest font.
const TFontSpec & aFontSpecThe specification of the font to be matched.
TInt aMaxHeightThe maximum height within which the font must fit.

IncrementFontCount(const CFont *)

IMPORT_C TBoolIncrementFontCount(const CFont *aFont)[protected]

Parameters

const CFont * aFont

NumTypefaces()

TInt NumTypefaces()const [pure virtual]

Gets the number of typefaces supported by the typeface store.

The number of supported typefaces.

ReleaseFont(CFont *)

IMPORT_C voidReleaseFont(CFont *aFont)

Parameters

CFont * aFont

SuperSubHeight(TInt, TFontPrintPosition)

IMPORT_C TIntSuperSubHeight(TIntaHeight,
TFontPrintPositionaPos
)[static]

Parameters

TInt aHeight
TFontPrintPosition aPos

TypefaceSupport(TTypefaceSupport &, TInt)

voidTypefaceSupport(TTypefaceSupport &aTypefaceSupport,
TIntaTypefaceIndex
)const [pure virtual]

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.

Parameters

TTypefaceSupport & aTypefaceSupportOn return, if the function executed successfully, this object contains the typeface information.
TInt aTypefaceIndexA typeface index number, in the range: zero to (NumTypefaces() - 1).

Member Data Documentation

CArrayFixFlat< TFontAccess > * iFontAccess

CArrayFixFlat< TFontAccess > *iFontAccess[protected]

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.