TFontSpec Class Reference

#include <gdi.h>

Link against: gdi.lib

class TFontSpec
Public Attributes
TFontStyle iFontStyle
TInt iHeight
TTypeface iTypeface
Public Member Functions
TFontSpec()
TFontSpec(const TDesC &, TInt)
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TIntScriptTypeForMetrics()
IMPORT_C voidSetScriptTypeForMetrics(TLanguage)
IMPORT_C TBooloperator==(const TFontSpec &)

Detailed Description

Specifies the font specification in device independent terms.

Member Attribute Documentation

iFontStyle

TFontStyle iFontStyle

The font style of the typeface.

iHeight

TInt iHeight

The height of the typeface (in twips).

iTypeface

TTypeface iTypeface

The typeface.

Constructor & Destructor Documentation

TFontSpec ( )

IMPORT_CTFontSpec()

Default constructor.

The object's font style is set to the default: EPostureUpright, EStrokeWeightNormal, and EPrintPosNormal.

TFontSpec ( const TDesC &, TInt )

IMPORT_CTFontSpec(const TDesC &aTypefaceName,
TIntaHeight
)

Constructs a TFontSpec object with the specified typeface and height.

The object's font style is set to the default: EPostureUpright, EStrokeWeightNormal, and EPrintPosNormal.

panic
GDI 6, if aTypefaceName is more than KMaxTypefaceNameLength characters long.
ParameterDescription
aTypefaceNameThe name of the typeface (e.g. "Roman"). It should be no longer than KMaxTypefaceNameLength characters in length.
aHeightThe height of the typeface, in twips.

Member Function Documentation

ExternalizeL ( RWriteStream & )

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalises the font specification to a write stream.

The presence of this function means that the standard templated operator<<() (defined in s32strm.h) is available to externalise objects of this class.

leave
KErrNoMemory If the write action causes the stream's resources to be exhausted.
ParameterDescription
aStreamThe stream to which the font specification is to be externalised

InternalizeL ( RReadStream & )

IMPORT_C voidInternalizeL(RReadStream &aStream)

Internalises a font specification from a read stream.

The presence of this function means that the standard templated operator>>() (defined in s32strm.h) is available to internalise objects of this class.

leave
KErrNoMemory If internalisation causes an out of memory error.
ParameterDescription
aStreamThe stream from which the font specification is to be internalised.

ScriptTypeForMetrics ( )

IMPORT_C TIntScriptTypeForMetrics()const

Returns the script with which font metrics calculation will be based on.

SetScriptTypeForMetrics ( TLanguage )

IMPORT_C voidSetScriptTypeForMetrics(TLanguageaLanguage)

Specifies the script with which font metrics calculation will be based on.

ParameterDescription
aLanguageThe language used to derive the required script.

operator== ( const TFontSpec & )

IMPORT_C TBooloperator==(const TFontSpec &aFontSpec)const

Compares this font specification with another.

ParameterDescription
aFontSpecThe font specification to be compared with this one.

Returns: ETrue, if the TFontSpecs are identical, EFalse otherwise.