Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: OPENFONT.H
Link against: fntstr.lib

Class TOpenFontSpec

class TOpenFontSpec : public TOpenFontFaceAttribBase;

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

Members

Defined in TOpenFontSpec:
BitmapType(), CompensateForAspectRatio(), CompensateForAspectRatio(), GetTFontSpec(), Height(), PrintPosition(), SetAttrib(), SetBitmapType(), SetHeight(), SetScriptTypeForMetrics(), SetSlantFactor(), SetWidthFactor(), SlantFactor(), TOpenFontSpec(), TOpenFontSpec(), WidthFactor(), operator=(), 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(), anonymous, iCoverage, iName, iReserved, iStyle


Construction and destruction


TOpenFontSpec()

IMPORT_C TOpenFontSpec();

Description

Default C++ constructor setting height to 16 pixels or twips, width factor to 1 (65536 in 16.16 format), slant factor to 0 (no slant), effects to ENone, symbol to 0 (assuming EScriptNone = 0), print position to EPrintPosNormal.


TOpenFontSpec()

IMPORT_C 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


operator=()

IMPORT_C void operator=(const TFontSpec &aFontSpec);

Description

Assignment operator.

Parameters

const TFontSpec &aFontSpec

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


operator==()

inline TBool operator==(const TOpenFontSpec &aFontSpec) const;

Description

Compares this and another open font specification. Compares all the properties of the two fonts.

Parameters

const TOpenFontSpec &aFontSpec

The open font specification to compare with this one.

Return value

TBool

ETrue if all values are equal, EFalse if not.


SetAttrib()

IMPORT_C void SetAttrib(const TOpenFontFaceAttribBase &aAttrib);

Description

Sets the font attributes.

Parameters

const TOpenFontFaceAttribBase &aAttrib

The font attributes.


GetTFontSpec()

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


CompensateForAspectRatio()

IMPORT_C void CompensateForAspectRatio(TInt aPixelWidth, TInt aPixelHeight);

Description

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

Parameters

TInt aPixelWidth

The pixel width, in the same units as aPixelHeight.

TInt aPixelHeight

The pixel height, in the same units as aPixelWidth.


CompensateForAspectRatio()

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


Height()

inline TInt Height() const;

Description

Gets the height of the font.

Return value

TInt

The height of the font, in pixels or twips.

See also:


WidthFactor()

inline 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:


SlantFactor()

inline 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:


BitmapType()

inline TGlyphBitmapType BitmapType() const;

Description

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

Return value

TGlyphBitmapType

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


PrintPosition()

inline TFontPrintPosition PrintPosition() const;

Description

Gets the print position.

Return value

TFontPrintPosition

The print position.


SetHeight()

inline void SetHeight(TInt aHeight);

Description

Sets the font's height.

Parameters

TInt aHeight

The font's height, in pixels or twips.

See also:


SetWidthFactor()

inline void SetWidthFactor(TInt32 aWidthFactor);

Description

Sets the algorithmic width factor.

The width factor is multiplied by the pixel's x position to get the new position, causing characters to become wider or narrower. A width factor of 1 (65536 in 16.16 fixed-point number format) should be used if the character width is not to be changed.

Parameters

TInt32 aWidthFactor

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

See also:


SetSlantFactor()

inline void SetSlantFactor(TInt32 aSlantFactor);

Description

Sets the algorithmic slant factor.

Note: The slant factor is used to create an italic effect for characters which do not have an italic glyph in the typeface. When slanting is active, pixel x co-ordinates are shifted by a factor relative to the y co-ordinate (i.e. x = x + y x slant factor).

The slant factor is a 32 bit, 16.16 fixed-point number. This means that the first 16 bits are treated as a whole number, and the second 16 as the fractional part. e.g. if aSlantFactor=0, there is no slant. If aSlantFactor=65536 this is equivalent to an integer slant value of 1, which causes a 45 degree slant on the character.

Parameters

TInt32 aSlantFactor

The slant factor as a 16.16 fixed-point number.

See also:


SetBitmapType()

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 the font should be drawn using anti-aliasing.


SetScriptTypeForMetrics()

IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage);

Description

Specifies the script with which font metrics calculation will be based on.

Parameters

TLanguage aLanguage

The language used to derive the required script.