TTypeface Class Reference

#include <gdi.h>

Link against: gdi.lib

class TTypeface
Public Attributes
TBufC< KMaxTypefaceNameLength >iName
Public Member Enumerations
enumanonymous { EProportional, ESerif, ESymbol }
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 &)

Detailed Description

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.

Member Attribute Documentation

iName

The typeface name.

Member Enumeration Documentation

Enum anonymous

EnumeratorValueDescription
EProportional1

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

ESerif2

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

ESymbol4

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

Constructor & Destructor Documentation

TTypeface ( )

IMPORT_CTTypeface()

Default C++ constructor.

Member Function Documentation

Attributes ( )

IMPORT_C TIntAttributes()const

Gets the combination of attributes of the typeface.

Returns: 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.

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

ParameterDescription
aStreamStream from which the typeface is to be internalised.

IsProportional ( )

IMPORT_C TBoolIsProportional()const

Gets the typeface's proportional attribute.

Returns: ETrue if the typeface is proportional, EFalse otherwise.

IsSerif ( )

IMPORT_C TBoolIsSerif()const

Gets the typeface's serif attribute.

Returns: ETrue if the typeface is a serif typeface, EFalse otherwise

IsSymbol ( )

IMPORT_C TBoolIsSymbol()const

Gets the typeface's symbol attribute.

Returns: ETrue if the typeface is a symbol typeface, EFalse otherwise

Name ( )

IMPORT_C const TDesC &Name()const

Returns the name of the typeface.

Returns: The name of the typeface.

ScriptTypeForMetrics ( )

IMPORT_C TIntScriptTypeForMetrics()const

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

Returns: The script.

SetAttributes ( TInt )

IMPORT_C voidSetAttributes(TIntaAttributes)

Set the combination of attributes for this typeface.

ParameterDescription
aAttributesA bitmap defining the combination of attributes.

SetIsProportional ( TBool )

IMPORT_C voidSetIsProportional(TBoolaIsProportional)

Sets the typeface's proportional attribute.

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

SetIsSerif ( TBool )

IMPORT_C voidSetIsSerif(TBoolaIsSerif)

Sets the typeface's serif attribute.

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

SetIsSymbol ( TBool )

IMPORT_C voidSetIsSymbol(TBoolaIsSymbol)

Sets the typeface's symbol attribute.

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

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

ParameterDescription
aScriptThe script.

operator== ( const TTypeface & )

IMPORT_C TBooloperator==(const TTypeface &aTypeface)const

Compares two typefaces for equality.

ParameterDescription
aTypefaceThe typeface to be compared with.

Returns: ETrue, if this TTypeface is equal to aTypeface, otherwise EFalse.