Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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:


Member functions


GetAvailableFontsL(const CGraphicsDevice &,CDesCArray &,TInt)

IMPORT_C static 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.

CDesC16Array &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(const CGraphicsDevice &,const TDesC &)

IMPORT_C static 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 TDesC16 &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(const CGraphicsDevice &,const TDesC &,CArrayFix< TInt > &)

IMPORT_C static 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 TDesC16 &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(const CGraphicsDevice &,const TDesC &,CArrayFix< TInt > &,CDesCArray &)

IMPORT_C static 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 TDesC16 &aTypefaceName

The name of the typeface.

CArrayFix< TInt > &aTwipsList

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

CDesC16Array &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(TInt)

IMPORT_C static 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(TInt)

IMPORT_C static 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(const TDesC &)

IMPORT_C static TInt TwipsFromPoints(const TDesC &aPoints);

Description

Converts a number of points held as text to twips.

Parameters

const TDesC16 &aPoints

A number of points as text.

Return value

TInt

A number of twips.


IndexOfNearestHeight(CArrayFix< TInt > &,TInt)

IMPORT_C static 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 FontUtils::GetAvailableHeightsInTwipsL(const CGraphicsDevice &,const TDesC &,CArrayFix< TInt > &) or FontUtils::GetAvailableHeightsInTwipsAndPointsL(const CGraphicsDevice &,const TDesC &,CArrayFix< TInt > &,CDesCArray &).

Return value

TInt

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