Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: gulutil.h
Link against: egul.lib

Class FontUtils

FontUtils

Support

Supported from 6.0

Description

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

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


Font information


GetAvailableFontsL()

static void GetAvailableFontsL(CGraphicsDevice& aDevice,CDesCArray& aFontNameList,TInt aFonts=EGulNoSymbolFonts);

Description

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

Parameters

CGraphicsDevice& aDevice

The graphics device.

CDesCArray& aFontNameList

On return, contains the list of typeface names.

TInt aFonts=EGulNoSymbolFonts

Font types. For possible values, see the flags defined in gulftflg.hrh beginning with EGulAllFonts.


TypefaceAttributes()

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

Description

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

Parameters

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 TInt GetAvailableHeightsInTwipsL(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

CGraphicsDevice& aDevice

The graphics device.

const TDesC& aTypefaceName

The name of the typeface.

const 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 TInt GetAvailableHeightsInTwipsAndPointsL(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

CGraphicsDevice& aDevice

The graphics device.

const TDesC& aTypefaceName

The name of the typeface.

const CArrayFix<TInt>& aTwipsList

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

const 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.


IndexOfNearestHeight()

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

Description

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

Parameters

CArrayFix<TInt>& aTwipsList

The twips list.

TInt aHeight

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

Return value

TInt

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

[Top]


Conversion between points and twips


PointsFromTwips()

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()

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()

static TInt TwipsFromPoints(const TDesC& aPoints);

Description

Converts a number of points in a descriptor to twips.

Parameters

const TDesC& aPoints

A number of points as text.

Return value

TInt

A number of twips.