TFontStyle Class Reference

#include <gdi.h>

Link against: gdi.lib

class TFontStyle

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

See also: CGraphicsContext::SetUnderlineStyle() CGraphicsContext::SetStrikethroughStyle()

Constructor & Destructor Documentation

TFontStyle ( )

IMPORT_CTFontStyle()

Default C++ constructor.

TFontStyle ( TFontPosture, TFontStrokeWeight, TFontPrintPosition )

IMPORT_CTFontStyle(TFontPostureaPost,
TFontStrokeWeightaStrWgt,
TFontPrintPositionaPrintPos
)

Constructs a TFontStyle object with the specified attributes.

ParameterDescription
aPostThe posture attribute.
aStrWgtThe stroke weight attribute.
aPrintPosThe print position attribute.

Member Function Documentation

BitmapType ( )

TGlyphBitmapType BitmapType()const [inline]

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

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

Effects ( )

IMPORT_C TUint32Effects()const

Gets the font effects flags.

See also: TFontStyle::SetEffects()

Returns: The font effects flags.

ExternalizeL ( RWriteStream & )

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

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.

leave
KErrNoMemory This function may leave, if the write action causes the stream's resources to be exhausted.
ParameterDescription
aStreamThe stream to which the font style is to be externalised.

InternalizeL ( RReadStream & )

IMPORT_C voidInternalizeL(RReadStream &aStream)

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.

leave
KErrNoMemory If there is a problem reading from the stream. If internalisation causes an out of memory error.
ParameterDescription
aStreamThe stream from which the font style is to be internalised

IsEffectOn ( FontEffect::TEffect )

IMPORT_C TBoolIsEffectOn(FontEffect::TEffectaEffect)const

Checks if a font effect is on.

See also: TFontStyle::SetEffects()

ParameterDescription
aEffectThe font effect to be checked.

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

Posture ( )

IMPORT_C TFontPosturePosture()const

Gets the posture attribute.

Returns: The font style's posture.

PrintPosition ( )

IMPORT_C TFontPrintPositionPrintPosition()const

Gets the print position attribute.

Returns: The font style's print position.

SetBitmapType ( TGlyphBitmapType )

voidSetBitmapType(TGlyphBitmapTypeaBitmapType)[inline]

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.

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

SetEffects ( TUint32 )

IMPORT_C voidSetEffects(TUint32aEffects)

Sets the font effects flags.

See also: TFontStyle::Effects()

SetEffects ( FontEffect::TEffect, TBool )

IMPORT_C voidSetEffects(FontEffect::TEffectaEffect,
TBoolaOn
)

Sets a font effect to the given state.

See also: TFontStyle::IsEffectOn()

ParameterDescription
aEffectThe font effect to be set.
aOnTrue represents on, otherwise off.

SetPosture ( TFontPosture )

IMPORT_C voidSetPosture(TFontPostureaPosture)

Sets the posture attribute.

ParameterDescription
aPostureThe posture to be set.

SetPrintPosition ( TFontPrintPosition )

IMPORT_C voidSetPrintPosition(TFontPrintPositionaPrintPosition)

Sets the print position attribute.

ParameterDescription
aPrintPositionThe print position to be set.

SetStrokeWeight ( TFontStrokeWeight )

IMPORT_C voidSetStrokeWeight(TFontStrokeWeightaStrokeWeight)

Sets the stroke weight attribute.

ParameterDescription
aStrokeWeightThe stroke weight to be set.

StrokeWeight ( )

IMPORT_C TFontStrokeWeightStrokeWeight()const

Gets the stroke weight attribute.

Returns: The font style's stroke weight.

operator== ( const TFontStyle & )

IMPORT_C TBooloperator==(const TFontStyle &aFontStyle)const

Compares a font style for equality.

ParameterDescription
aFontStyleThe font style to be compared with this font style.

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