Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: gulutil.h
Link against: egul.lib

Class FontUtils

class FontUtils;

Description

Provides static functions for getting information about the fonts supported by a graphics device.

Members

Defined in FontUtils:
GetAvailableFontsL(), GetAvailableHeightsInTwipsAndPointsL(), GetAvailableHeightsInTwipsL(), IndexOfNearestHeight(), PointsFromTwips(), TwipsFromPoints(), TwipsFromPoints(), TypefaceAttributes()


Member functions


GetAvailableFontsL()

static IMPORT_C void GetAvailableFontsL(const CGraphicsDevice &aDevice, CDesCArray &aFontNameList, TInt aFonts=0x10);

Description

Gets the list of typeface names available for the graphics device.

Parameters

const CGraphicsDevice &aDevice

The graphics device.

CDesCArray &aFontNameList

On return, contains the list of typeface names.

TInt aFonts

Can be used to specify which sorts of typefaces are required. For possible values, see the flags defined in gulftflg.hrh beginning with EGulAllFonts.


TypefaceAttributes()

static IMPORT_C TInt TypefaceAttributes(const CGraphicsDevice &aDevice, const TDesC &aTypefaceName);

Description

Gets the attributes of a named typeface, if supported by the graphics device.

Parameters

const CGraphicsDevice &aDevice

The graphics device.

const TDesC &aTypefaceName

The name of the typeface.

Return value

TInt

The typeface attributes. Attributes are zero if the typeface is not supported by the graphics device. Attribute values are defined in TTypeface.


GetAvailableHeightsInTwipsL()

static IMPORT_C TInt GetAvailableHeightsInTwipsL(const CGraphicsDevice &aDevice, const TDesC &aTypefaceName, CArrayFix< TInt > &aHeightList);

Description

Gets a list of all heights in twips, available for the named typeface and the graphics device specified.

Parameters

const CGraphicsDevice &aDevice

The graphics device.

const TDesC &aTypefaceName

The name of the typeface.

CArrayFix< TInt > &aHeightList

On return, contains all available heights for the typeface, in twips.

Return value

TInt

KErrNotSupported if the named typeface is not supported by the graphics device, otherwise KErrNone.


GetAvailableHeightsInTwipsAndPointsL()

static IMPORT_C TInt GetAvailableHeightsInTwipsAndPointsL(const CGraphicsDevice &aDevice, const TDesC &aTypefaceName, CArrayFix< TInt > &aTwipsList, CDesCArray &aPointsList);

Description

Gets a list of all heights in twips, available for the named typeface and the graphics device specified.

Also gets a list of heights in points, represented as character strings.

Parameters

const CGraphicsDevice &aDevice

The graphics device.

const TDesC &aTypefaceName

The name of the typeface.

CArrayFix< TInt > &aTwipsList

On return, contains all available heights for the typeface, in twips.

CDesCArray &aPointsList

On return, the heights in points, represented as character strings.

Return value

TInt

KErrNotSupported if the named typeface is not supported by the graphics device, otherwise KErrNone.


PointsFromTwips()

static IMPORT_C TInt PointsFromTwips(TInt aTwips);

Description

Converts a number of twips to points.

Parameters

TInt aTwips

A number of twips.

Return value

TInt

A number of points.


TwipsFromPoints()

static IMPORT_C TInt TwipsFromPoints(TInt aPoints);

Description

Converts a number of points into twips.

Parameters

TInt aPoints

A number of points.

Return value

TInt

A number of twips.


TwipsFromPoints()

static IMPORT_C TInt TwipsFromPoints(const TDesC &aPoints);

Description

Converts a number of points held as text to twips.

Parameters

const TDesC &aPoints

A number of points as text.

Return value

TInt

A number of twips.


IndexOfNearestHeight()

static IMPORT_C TInt IndexOfNearestHeight(CArrayFix< TInt > &aTwipsList, TInt aHeight);

Description

Gets the index into the supplied list of font heights of the closest match to the font height specified.

Parameters

CArrayFix< TInt > &aTwipsList

The twips list.

TInt aHeight

The requested font height. This may be generated by a call to GetAvailableHeightsInTwipsL() or GetAvailableHeightsInTwipsAndPointsL().

Return value

TInt

The index into the list of the closest font height to aHeight.