Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: openfont.h
Link against: fntstr.lib

Class TOpenFontSpec

TOpenFontSpec

Support

Supported from 5.0

Description

Font specification allowing more attributes to be specified than TFontSpec.

In addition to the attributes specified by TFontSpec, this font specification allows stretching and slanting in the x dimension, and other algorithmic effects. This is used to correct for non-square pixels, and to allow algorithmic slanting and bold. The width factor and slant factor transform any point (x,y) to (x * iWidthFactor + y * iSlantFactor,y). The width and slant factors are 16.16 fixed-point numbers.

The font specification also provides access to information about the scripts which are supported by the font. This information is not always reliable, because it may be incorrectly specified, or not specified at all, by some font manufacturers.

Derivation

TOpenFontFaceAttribBaseFont attribute base class
TOpenFontSpecFont specification allowing more attributes to be specified than TFontSpec

Defined in TOpenFontSpec:
Anonymous, CompensateForAspectRatio(), EAlgorithmicBold, EDropShadow, EOutline, Effects(), GetTFontSpec(), Height(), PrintPosition(), SetAttrib(), SetEffects(), SetHeight(), SetSlantFactor(), SetWidthFactor(), SlantFactor(), TOpenFontSpec(), WidthFactor(), operator=()

Inherited from TOpenFontFaceAttribBase:
Coverage(), EArabicSet, EArmenianSet, EBengaliSet, EBold, ECJKSet, ECyrillicSet, EDevanagariSet, EGeorgianSet, EGreekSet, EGujuratiSet, EGurmukhiSet, EHangulJamoSet, EHangulSet, EHebrewSet, EItalic, EKanaSets, EKannadaSet, ELaoSet, ELatinSet, EMalayalamSet, EMonoWidth, ENameLength, EOriyaSet, ESerif, ESymbolSets, ETamilSet, ETeluguSet, EThaiSet, HasCJK(), HasCyrillic(), HasGreek(), HasHangul(), HasKana(), HasLatin(), IsBold(), IsItalic(), IsMonoWidth(), IsSerif(), IsSymbol(), Name(), SetBold(), SetCoverage(), SetItalic(), SetMonoWidth(), SetName(), SetSerif(), operator==()


Construction and destruction


TOpenFontSpec()

TOpenFontSpec();

Description

Default C++ constructor.

Sets the height to 16, width factor to 1 (65536 in 16.16 format), slant factor to 0 (no slant), effects to 0, symbol to FALSE, and print position to EPrintPosNormal.


TOpenFontSpec()

TOpenFontSpec(const TFontSpec& aFontSpec);

Description

C++ constructor taking a reference to a TFontSpec.

This object's members are initialised from the values of the aFontSpec parameter.

Parameters

const TFontSpec& aFontSpec

The font specification used to initialise this font specification.

[Top]


Member functions


CompensateForAspectRatio()

void CompensateForAspectRatio(TInt aKPixelWidth,TInt aKPixelHeight);

Description

Adjust the width factor and slant factor to suit a pixel aspect ratio.

Notes:

Parameters

TInt aKPixelWidth

The pixel width, in the same units as aKPixelHeight.

TInt aKPixelHeight

The pixel height, in the same units as aKPixelWidth.


CompensateForAspectRatio()

void CompensateForAspectRatio(const MGraphicsDeviceMap& aMap);

Description

Adjust the width factor and slant factor to suit a pixel aspect ratio stored in a MGraphicsDeviceMap derived object.

Parameters

const MGraphicsDeviceMap& aMap

The MGraphicsDeviceMap defining the pixel aspect ratio.


Effects()

TUint32 Effects() const;

Description

Gets the algorithmic effects flags.

This is the logical ORing of values in this class's anonymous enum — e.g. EAlgorithmicBold.

Return value

TUint32

The effects flags.

See also:


GetTFontSpec()

void GetTFontSpec(TFontSpec& aFontSpec) const;

Description

Gets the TFontSpec corresponding to this Open Font System font specification.

Parameters

TFontSpec& aFontSpec

On return, contains the TFontSpec corresponding to this font specification.


Height()

TInt Height() const;

Description

Gets the height of the font.

Return value

TInt

The height of the font, in pixels or twips.

See also:


PrintPosition()

TFontPrintPosition PrintPosition() const;

Description

Gets the print position.

Return value

TFontPrintPosition

The print position.


SetAttrib()

void SetAttrib(const TOpenFontFaceAttribBase& aAttrib);

Description

Sets the font attributes.

Parameters

const TOpenFontFaceAttribBase& aAttrib

The font attributes.


SetEffects()

void SetEffects(TUint32 aEffects);

Description

Sets the effects flags.

The flags are the logical ORing of values in this class's anonymous enum — e.g. EAlgorithmicBold.

Parameters

TUint32 aEffects

The effects flags.

See also:


SetHeight()

void SetHeight(TInt aHeight);

Description

Sets the font's height.

Parameters

TInt aHeight

The font's height, in pixels or twips.

See also:


SetSlantFactor()

void SetSlantFactor(TInt32 aSlantFactor);

Description

Sets the algorithmic slant factor.

Note:

Parameters

TInt32 aSlantFactor

The slant factor as a 16.16 fixed-point number.

See also:


SetWidthFactor()

void SetWidthFactor(TInt32 aWidthFactor);

Description

Sets the algorithmic width factor.

Parameters

TInt32 aWidthFactor

The algorithmic width factor as a 16.16 fixed-point number.

See also:


SlantFactor()

TInt32 SlantFactor() const;

Description

Gets the algorithmic slant factor.

Return value

TInt32

The algorithmic slant factor as a 16.16 fixed-point number.

See also:


WidthFactor()

TInt32 WidthFactor() const;

Description

Gets the algorithmic width factor.

Return value

TInt32

The algorithmic width factor as a 16.16 fixed-point number.

See also:


operator=()

void operator=(const TFontSpec& aFontSpec);

Description

Assignment operator.

Parameters

const TFontSpec& aFontSpec

The old-style font specification to copy into this font specification.

[Top]


Enumerations


Enum Anonymous

Anonymous

Description

Algorothmic effects flags. These can be combined using an OR operation.

EAlgorithmicBold

Font is algorithmic bold.

EDropShadow

Font has a drop shadow.

EOutline

Font is an outline font.