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 TInt Attributes ()
IMPORT_C void ExternalizeL ( RWriteStream &)
IMPORT_C void InternalizeL ( RReadStream &)
IMPORT_C TBool IsProportional ()
IMPORT_C TBool IsSerif ()
IMPORT_C TBool IsSymbol ()
IMPORT_C const TDesC & Name ()
IMPORT_C TInt ScriptTypeForMetrics ()
IMPORT_C void SetAttributes ( TInt )
IMPORT_C void SetIsProportional ( TBool )
IMPORT_C void SetIsSerif ( TBool )
IMPORT_C void SetIsSymbol ( TBool )
IMPORT_C void SetName (const TDesC &)
IMPORT_C void SetScriptTypeForMetrics ( TLanguage )
IMPORT_C void SetScriptTypeForMetrics ( TInt )
IMPORT_C TBool operator== (const TTypeface &)
Private Member Functions
void ResetAttributes ()
void ResetScriptType ()
Public Member Enumerations
enum anonymous { EProportional  = 1, ESerif  = 2, ESymbol  = 4 }
Public Attributes
TBufC < KMaxTypefaceNameLength > iName
Private Attributes
TUint32 iFlags

Constructor & Destructor Documentation

TTypeface()

IMPORT_C TTypeface ( )

Default C++ constructor.

Member Functions Documentation

Attributes()

IMPORT_C TInt Attributes ( ) const

Gets the combination of attributes of the typeface.

ExternalizeL(RWriteStream &)

IMPORT_C void ExternalizeL ( 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 & aStream The stream to which the typeface is to be externalised.

InternalizeL(RReadStream &)

IMPORT_C void InternalizeL ( 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 & aStream Stream from which the typeface is to be internalised.

IsProportional()

IMPORT_C TBool IsProportional ( ) const

Gets the typeface's proportional attribute.

IsSerif()

IMPORT_C TBool IsSerif ( ) const

Gets the typeface's serif attribute.

IsSymbol()

IMPORT_C TBool IsSymbol ( ) const

Gets the typeface's symbol attribute.

Name()

IMPORT_C const TDesC & Name ( ) const

Returns the name of the typeface.

ResetAttributes()

void ResetAttributes ( ) [private]

ResetScriptType()

void ResetScriptType ( ) [private]

ScriptTypeForMetrics()

IMPORT_C TInt ScriptTypeForMetrics ( ) const

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

SetAttributes(TInt)

IMPORT_C void SetAttributes ( TInt aAttributes )

Set the combination of attributes for this typeface.

Parameters

TInt aAttributes A bitmap defining the combination of attributes.

SetIsProportional(TBool)

IMPORT_C void SetIsProportional ( TBool aIsProportional )

Sets the typeface's proportional attribute.

Parameters

TBool aIsProportional ETrue if the typeface is a proportional typeface, otherwise EFalse.

SetIsSerif(TBool)

IMPORT_C void SetIsSerif ( TBool aIsSerif )

Sets the typeface's serif attribute.

Parameters

TBool aIsSerif ETrue if the typeface is a serif typeface, otherwise EFalse.

SetIsSymbol(TBool)

IMPORT_C void SetIsSymbol ( TBool aIsSymbol )

Sets the typeface's symbol attribute.

Parameters

TBool aIsSymbol ETrue if the typeface is a symbol typeface, otherwise EFalse.

SetName(const TDesC &)

IMPORT_C void SetName ( 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 & aName The name of the typeface (e.g. "Roman"). It should be no longer than KMaxTypefaceNameLength characters in length.

SetScriptTypeForMetrics(TLanguage)

IMPORT_C void SetScriptTypeForMetrics ( TLanguage aLanguage )

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

Parameters

TLanguage aLanguage The language used to derive the required script.

SetScriptTypeForMetrics(TInt)

IMPORT_C void SetScriptTypeForMetrics ( TInt aScript )

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

Parameters

TInt aScript The script.

operator==(const TTypeface &)

IMPORT_C TBool operator== ( const TTypeface & aTypeface ) const

Compares two typefaces for equality.

Parameters

const TTypeface & aTypeface The 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.