Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: gdi.h
Link against: N/A

Class TFontSpec

TFontSpec

Support

Supported from 5.0

Description

Font specification.

This class specifies the font in device independent terms.

Defined in TFontSpec:
ExternalizeL(), InternalizeL(), TFontSpec(), iFontStyle, iHeight, iTypeface, operator==()


Construction and destruction


TFontSpec()

TFontSpec();

Description

Default constructor.

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


TFontSpec()

TFontSpec(const TDesC& aTypefaceName,TInt aHeight);

Description

Constructs a TFontSpec object with the specified typeface and height.

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

Parameters

const TDesC& aTypefaceName

The name of the typeface (e.g. "Roman").

TInt aHeight

The height of the typeface, in twips.

[Top]


Comparison


operator==()

TBool operator==(const TFontSpec& aFontSpec) const;

Description

Compares a font specification for equality.

Parameters

const TFontSpec& aFontSpec

The font specification to be compared with this font specification

Return value

TBool

ETrue, if this TFontSpec is identical to aFontSpec, EFalse otherwise

[Top]


Streaming


InternalizeL()

void InternalizeL(RReadStream& aStream);

Description

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.

Parameters

RReadStream& aStream

The stream from which the font specification is to be internalised.

Leave codes

KErrNoMemory

If internalisation causes an out of memory error.

 

If there is a problem reading from the stream.


ExternalizeL()

void ExternalizeL(RWriteStream& aStream) const;

Description

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.

Parameters

RWriteStream& aStream

The stream to which the font specification is to be externalised

Leave codes

KErrNoMemory

If the write action causes the stream's resources to be exhausted.

[Top]


Public data members


iFontStyle

TFontStyle iFontStyle

Description

The font style of the typeface.


iHeight

TInt iHeight

Description

The height of the typeface (in twips).


iTypeface

TTypeface iTypeface

Description

The typeface.