TTypeface Class Reference

class TTypeface

Typeface name and attributes.

This class identifies a typeface by name, and contains the combination of attributes of the typeface. These attributes define whether it is a symbol typeface, whether the typeface is proportional, and whether it is serif or sans-serif.

The combination of attributes for a typeface are stored in a bitmask, with the various bits indicating different attributes. The bitmask is calculated for any particular attribute combination by ORing the enumerated value for each individual attribute.

Public Member Functions
TTypeface()
IMPORT_C TIntAttributes()
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsProportional()
IMPORT_C TBoolIsSerif()
IMPORT_C TBoolIsSymbol()
IMPORT_C const TDesC &Name()
IMPORT_C TIntScriptTypeForMetrics()
IMPORT_C voidSetAttributes(TInt)
IMPORT_C voidSetIsProportional(TBool)
IMPORT_C voidSetIsSerif(TBool)
IMPORT_C voidSetIsSymbol(TBool)
IMPORT_C voidSetName(const TDesC &)
IMPORT_C voidSetScriptTypeForMetrics(TLanguage)
IMPORT_C voidSetScriptTypeForMetrics(TInt)
IMPORT_C TBooloperator==(const TTypeface &)
Private Member Functions
voidResetAttributes()
voidResetScriptType()
Public Member Enumerations
enumanonymous { EProportional = 1, ESerif = 2, ESymbol = 4 }
Public Attributes
TBufC< KMaxTypefaceNameLength >iName
Private Attributes
TUint32 iFlags

Constructor & Destructor Documentation

TTypeface()

IMPORT_CTTypeface()

Default C++ constructor.

Member Functions Documentation

Attributes()

IMPORT_C TIntAttributes()const

Gets the combination of attributes of the typeface.

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalises a typeface 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.

Parameters

RWriteStream & aStreamThe stream to which the typeface is to be externalised.

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(RReadStream &aStream)

Internalises a typeface 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.

Parameters

RReadStream & aStreamStream from which the typeface is to be internalised.

IsProportional()

IMPORT_C TBoolIsProportional()const

Gets the typeface's proportional attribute.

IsSerif()

IMPORT_C TBoolIsSerif()const

Gets the typeface's serif attribute.

IsSymbol()

IMPORT_C TBoolIsSymbol()const

Gets the typeface's symbol attribute.

Name()

IMPORT_C const TDesC &Name()const

Returns the name of the typeface.

ResetAttributes()

voidResetAttributes()[private]

ResetScriptType()

voidResetScriptType()[private]

ScriptTypeForMetrics()

IMPORT_C TIntScriptTypeForMetrics()const

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

SetAttributes(TInt)

IMPORT_C voidSetAttributes(TIntaAttributes)

Set the combination of attributes for this typeface.

Parameters

TInt aAttributesA bitmap defining the combination of attributes.

SetIsProportional(TBool)

IMPORT_C voidSetIsProportional(TBoolaIsProportional)

Sets the typeface's proportional attribute.

Parameters

TBool aIsProportionalETrue if the typeface is a proportional typeface, otherwise EFalse.

SetIsSerif(TBool)

IMPORT_C voidSetIsSerif(TBoolaIsSerif)

Sets the typeface's serif attribute.

Parameters

TBool aIsSerifETrue if the typeface is a serif typeface, otherwise EFalse.

SetIsSymbol(TBool)

IMPORT_C voidSetIsSymbol(TBoolaIsSymbol)

Sets the typeface's symbol attribute.

Parameters

TBool aIsSymbolETrue if the typeface is a symbol typeface, otherwise EFalse.

SetName(const TDesC &)

IMPORT_C voidSetName(const TDesC &aName)
Sets the name of the typeface. This method should be used rather than directly accessing the iName public member.
panic
GDI 6, if aName is more than KMaxTypefaceNameLength characters long.

Parameters

const TDesC & aNameThe name of the typeface (e.g. "Roman"). It should be no longer than KMaxTypefaceNameLength characters in length.

SetScriptTypeForMetrics(TLanguage)

IMPORT_C voidSetScriptTypeForMetrics(TLanguageaLanguage)

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

Parameters

TLanguage aLanguageThe language used to derive the required script.

SetScriptTypeForMetrics(TInt)

IMPORT_C voidSetScriptTypeForMetrics(TIntaScript)

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

Parameters

TInt aScriptThe script.

operator==(const TTypeface &)

IMPORT_C TBooloperator==(const TTypeface &aTypeface)const

Compares two typefaces for equality.

Parameters

const TTypeface & aTypefaceThe typeface to be compared with.

Member Enumerations Documentation

Enum anonymous

Enumerators

EProportional = 1

Typeface is a proportional typeface (e.g. Swiss)

ESerif = 2

Typeface is a serif typeface (e.g. Times)

ESymbol = 4

Typeface is a symbol typeface (e.g. Symbol)

Member Data Documentation

TUint32 iFlags

TUint32 iFlags[private]

TBufC< KMaxTypefaceNameLength > iName

TBufC< KMaxTypefaceNameLength >iName

The typeface name.