Symbian
 Developer Library

DEVELOPER LIBRARY

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



Location: gdi.h
Link against: N/A

Class TFontStyle

TFontStyle

Support

Supported from 5.0

Description

Encapsulates a font style.

The font style information is comprised of:

Note that the underline and strike-through attributes are not included in this class, but are set in the graphics context.

Defined in TFontStyle:
BitmapType(), ExternalizeL(), InternalizeL(), Posture(), PrintPosition(), SetBitmapType(), SetPosture(), SetPrintPosition(), SetStrokeWeight(), StrokeWeight(), TFontStyle(), TFontStyle(), operator==()

See also:


Construction and destruction


TFontStyle()

TFontStyle();

Description

Default C++ constructor.


TFontStyle()

TFontStyle(TFontPosture aPost,TFontStrokeWeight aStrWgt,TFontPrintPosition aPrintPos);

Description

Constructs a TFontStyle object with the specified attributes.

Parameters

TFontPosture aPost

The posture attribute.

TFontStrokeWeight aStrWgt

The stroke weight attribute.

TFontPrintPosition aPrintPos

The print position attribute.

[Top]


Comparison operator


operator==()

TBool operator==(const TFontStyle& aFontStyle) const;

Description

Compares a font style for equality.

Parameters

const TFontStyle& aFontStyle

The font style to be compared with this font style.

Return value

TBool

ETrue, if this TFontStyle is equal to aFontStyle, EFalse, otherwise.

[Top]


Streaming


ExternalizeL()

void ExternalizeL(RWriteStream& aStream) const;

Description

Externalises the font style 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 style is to be externalised.

Leave codes

KErrNoMemory

This function may leave, if the write action causes the stream's resources to be exhausted.


InternalizeL()

void InternalizeL(RReadStream& aStream);

Description

Internalises a font style 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 style is to be internalised

Leave codes

If there is a problem reading from the stream.

KErrNoMemory

If internalisation causes an out of memory error.

[Top]


Setting font style attributes


SetPosture()

void SetPosture(TFontPosture aPosture);

Description

Sets the posture attribute of the font style.

Parameters

TFontPosture aPosture

The posture to be set.


SetStrokeWeight()

void SetStrokeWeight(TFontStrokeWeight aStrokeWeight);

Description

Sets the stroke weight attribute of the font style.

Parameters

TFontStrokeWeight aStrokeWeight

The stroke weight to be set.


SetPrintPosition()

void SetPrintPosition(TFontPrintPosition aPrintPosition);

Description

Sets the print position attribute of the font style.

Parameters

TFontPrintPosition aPrintPosition

The print position to be set.


SetBitmapType()

inline void SetBitmapType(TGlyphBitmapType aBitmapType);

Support

Supported from 7.0

Description

Sets whether the font should be drawn using anti-aliasing. If set, this value overrides the default setting (set by CFbsTypefaceStore::SetDefaultBitmapType()) for this font.

Parameters

TGlyphBitmapType aBitmapType

Indicates whether or not this font should be drawn using anti-aliasing.

Notes:

[Top]


Getting font style attributes


Posture()

TFontPosture Posture() const;

Description

Gets the posture attribute of the font style.

Return value

TFontPosture

The font style's posture.


StrokeWeight()

TFontStrokeWeight StrokeWeight() const;

Description

Gets the stroke weight attribute of the font style.

Return value

TFontStrokeWeight

The font style's stroke weight.


PrintPosition()

TFontPrintPosition PrintPosition() const;

Description

Gets the print position attribute of the font style.

Return value

TFontPrintPosition

The font style's print position.


BitmapType()

inline TGlyphBitmapType BitmapType() const;

Support

Supported from 7.0

Description

Gets the anti-aliasing setting for the font, as set by SetBitmapType().

Return value

TGlyphBitmapType

Indicates whether or not this font should be drawn using anti-aliasing.