Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GDI.H>
Link against: gdi.lib

Class TFontStyle

class TFontStyle;

Description

Encapsulates a font style.

The font style information is comprised of:

the posture of the font upright or italic

the stroke weight of the font normal or bold

the print position of the font normal, subscript or superscript

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

Members

Defined in TFontStyle:

See also:


Construction and destruction


TFontStyle()

IMPORT_C TFontStyle();

Description

Default C++ constructor.


TFontStyle(TFontPosture,TFontStrokeWeight,TFontPrintPosition)

IMPORT_C 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]


Member functions


InternalizeL(RReadStream &)

IMPORT_C void InternalizeL(RReadStream &aStream);

Description

Internalises a font style from a read stream.

The presence of this function means that the standard templated operator>>(RReadStream &,T &) (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

KErrNoMemory

If there is a problem reading from the stream. If internalisation causes an out of memory error.


ExternalizeL(RWriteStream &)const

IMPORT_C 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<<(RWriteStream &,const T &) (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.


Posture()const

IMPORT_C TFontPosture Posture() const;

Description

Gets the posture attribute.

Return value

TFontPosture

The font style's posture.


StrokeWeight()const

IMPORT_C TFontStrokeWeight StrokeWeight() const;

Description

Gets the stroke weight attribute.

Return value

TFontStrokeWeight

The font style's stroke weight.


PrintPosition()const

IMPORT_C TFontPrintPosition PrintPosition() const;

Description

Gets the print position attribute.

Return value

TFontPrintPosition

The font style's print position.


SetPosture(TFontPosture)

IMPORT_C void SetPosture(TFontPosture aPosture);

Description

Sets the posture attribute.

Parameters

TFontPosture aPosture

The posture to be set.


SetStrokeWeight(TFontStrokeWeight)

IMPORT_C void SetStrokeWeight(TFontStrokeWeight aStrokeWeight);

Description

Sets the stroke weight attribute.

Parameters

TFontStrokeWeight aStrokeWeight

The stroke weight to be set.


SetPrintPosition(TFontPrintPosition)

IMPORT_C void SetPrintPosition(TFontPrintPosition aPrintPosition);

Description

Sets the print position attribute.

Parameters

TFontPrintPosition aPrintPosition

The print position to be set.


BitmapType()const

inline TGlyphBitmapType BitmapType() const;

Description

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

Return value

TGlyphBitmapType

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


SetBitmapType(TGlyphBitmapType)

inline void SetBitmapType(TGlyphBitmapType aBitmapType);

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.

Anti-aliasing can only be used for scalable fonts. There is currently no anti-aliasing support for bitmapped fonts.

Parameters

TGlyphBitmapType aBitmapType

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


operator==(const TFontStyle &)const

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


Effects()const

IMPORT_C TUint32 Effects() const;

Description

Gets the font effects flags.

Return value

TUint32

The font effects flags.

See also:


IsEffectOn(FontEffect::TEffect)const

IMPORT_C TBool IsEffectOn(FontEffect::TEffect aEffect) const;

Description

Checks if a font effect is on.

Parameters

FontEffect::TEffect aEffect

The font effect to be checked.

Return value

TBool

True represents the specified font effect is on, otherwise off.

See also:


SetEffects(TUint32)

IMPORT_C void SetEffects(TUint32 aEffects);

Description

Sets the font effects flags.

Parameters

TUint32 aEffects

See also:


SetEffects(FontEffect::TEffect,TBool)

IMPORT_C void SetEffects(FontEffect::TEffect aEffect, TBool aOn);

Description

Sets a font effect to the given state.

Parameters

FontEffect::TEffect aEffect

The font effect to be set.

TBool aOn

True represents on, otherwise off.

See also: