Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: txtfrmat.h
Link against: etext.lib

Class TCharFormat

TCharFormat

Support

Supported from 5.0

Description

A transient container of character format attributes, including font-dependent and font-independent attributes. The font-independent attributes are stored in a TFontPresentation object. Rich and global text objects store character formatting using character format layers (see class CCharFormatLayer). The TCharFormat class is used to store the relevant attribute values when setting or sensing a CCharFormatLayer. It is normally used in combination with a TCharFormatMask, to specify which attributes are relevant to the function concerned.

Defined in TCharFormat:
IsEqual(), TCharFormat(), iFontPresentation, iFontSpec, iLanguage


Construction


TCharFormat()

TCharFormat();

Description

Allocates and constructs a TCharFormat object. The font-independent attributes are initialised with default values. The language is initialised to zero. The font (iFontSpec) is set to be proportional and serif and to have a height of 200 twips. The typeface name is not initialised.


TCharFormat()

TCharFormat(const TDesC &aTypefaceName,TInt aHeight);

Description

The C++ constructor is used to construct the TCharFormat object with a font (typeface name and font height). The font-independent attributes are initialised to default values; for details, see class TFontPresentation. The language is initialised to zero.

Parameters

const TDesC &aTypefaceName

Specifies the typeface name.

TInt aHeight

Specifies the font height in twips.

[Top]


Equality


IsEqual()

TBool IsEqual(const TCharFormat& aFormat)const;

Description

Compares all attribute values for equality.

Parameters

const TCharFormat& aFormat

Contains the attribute values to compare.

Return value

TBool

ETrue if the two format containers have the same values for all attributes, EFalse if not.


IsEqual()

TBool IsEqual(const TCharFormat& aFormat,const TCharFormatMask& aMask)const;

Description

Compares selected attribute values for equality. Only the attributes specified in the mask are involved in the comparison.

Parameters

const TCharFormat& aFormat

Contains the attribute values to compare.

const TCharFormatMask& aMask

Bitmask specifying the attributes to compare.

Return value

TBool

ETrue if the two format containers have the same values for the attributes specified in the mask, EFalse if not.

[Top]


Data members


iFontSpec

TFontSpec iFontSpec

Description

Device independent font specification.


iFontPresentation

TFontPresentation iFontPresentation

Description

Font independent character format attributes.


iLanguage

TInt32 iLanguage

Description

Specifies the language of individual characters for proofing. Used for example when spell checking a document which contains text in more than one language, so that the program recognises the text as being in another language. Language is also a paragraph format attribute. If the language setting of a character is different from the language setting of the containing paragraph, the character's setting takes precedence.