Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: gdi.h
Link against: gdi.lib

Class CTypefaceStore

CTypefaceStore

Support

Supported from 5.0

Description

Typeface store abstract base interface.

This class provides the interface of a store for typefaces.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CTypefaceStoreTypeface store abstract base interface

Defined in CTypefaceStore:
BaselineOffset(), FontHeightInTwips(), GetNearestFontInTwips(), NumTypefaces(), ReleaseFont(), SuperSubHeight(), TypefaceSupport(), ~CTypefaceStore()

Inherited from CBase:
operator new()


Construction and destruction


~CTypefaceStore()

~CTypefaceStore();

Description

Destructor.

This destroys the typeface store and reclaims the memory allocated to it.

[Top]


Getting and releasing fonts


GetNearestFontInTwips()

virtual TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec)=0;

Description

Gets the bitmap font in the current graphics map which is nearest to the specified font specification.

Parameters

CFont*& aFont

On return, contains a pointer to the nearest bitmap font.

const TFontSpec& aFontSpec

The device independent font specification of the font to be found.

Return value

TInt

KErrNone if no nearest font can be found or if there was no error, KErrNoMemory if a nearest font can be found but no memory can be allocated to it in the font store, or another of the system-wide error codes.


ReleaseFont()

void ReleaseFont(CFont* aFont);

Description

Releases the client's hold on a specified font in the font store.

The font store keeps a list of fonts which it contains and, for each font, an access-count of the number of clients using that font. This function 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.

Parameters

CFont* aFont

The font to be released from the font store.

[Top]


Getting typeface and font information


NumTypefaces()

virtual TInt NumTypefaces() const=0;

Description

Gets the number of typefaces supported by the typeface store.

Return value

TInt

The number of supported typefaces.


TypefaceSupport()

virtual void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const=0;

Description

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& aTypefaceSupport

On return, if the function executed successfully, this object contains the typeface information.

TInt aTypefaceIndex

A typeface index number, in the range: zero to (NumTypefaces() - 1).


FontHeightInTwips()

virtual TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const=0;

Description

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.

Parameters

TInt aTypefaceIndex

A typeface index number, in the range: 0 to (NumTypefaces() - 1).

TInt aHeightIndex

A font height index number, in the range: 0 to (iNumHeights - 1). Note: TTypefaceSupport::iNumHeights is returned by TypefaceSupport().

Return value

TInt

The height of the font, in twips.

[Top]


Handling subscript and superscript


BaselineOffset()

static TInt BaselineOffset(TInt aHeight,TFontPrintPosition aPos);

Description

Gets the baseline offset for a superscript or subscript font, in twips.

The baseline offset is obtained from the height of the current font and the print position of the required font.

Parameters

TInt aHeight

The height of the current font.

TFontPrintPosition aPos

The print position of the required font: superscript, subscript or normal.

Return value

TInt

The baseline offset for the required font.


SuperSubHeight()

static TInt SuperSubHeight(TInt aHeight,TFontPrintPosition aPos);

Description

Gets the height for a superscript or subscript font.

The height is obtained from the height of the current font.

Parameters

TInt aHeight

The height of the current font.

TFontPrintPosition aPos

The print position of the required font: superscript, subscript or normal.

Return value

TInt

The height of the required font.