Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: OPENFONT.H
Link against: fntstr.lib

Class TOpenFontCharMetrics

class TOpenFontCharMetrics;

Description

Character metrics includes more information than TCharacterMetrics.

Character metrics allow characters to be placed horizontally or vertically. The character metrics encapsulated by this class are: Height, Width, Horizontal Bearing X, Horizontal Bearing Y, Horizontal Advance, Vertical Bearing X, Vertical Bearing Y, and Vertical Advance. Their meanings are described in the associated setter and getter functions.

Note :

Vertical drawing (in the sense of characters drawn with horizontal baselines, but in a vertical line) is not yet supported by Symbian OS.

Members

Defined in TOpenFontCharMetrics:
EUninitialized, GetHorizBounds(), GetTCharacterMetrics(), GetVertBounds(), Height(), HorizAdvance(), HorizBearingX(), HorizBearingY(), SetHeight(), SetHorizAdvance(), SetHorizBearingX(), SetHorizBearingY(), SetVertAdvance(), SetVertBearingX(), SetVertBearingY(), SetWidth(), TOpenFontCharMetrics(), TOpenFontCharMetrics(), TOpenFontCharMetrics(), TUninitialized, VertAdvance(), VertBearingX(), VertBearingY(), Width()

See also:


Construction and destruction


TOpenFontCharMetrics()

inline TOpenFontCharMetrics();

Description

Default constructor initializes all members to 0.


TOpenFontCharMetrics()

inline TOpenFontCharMetrics(TUninitialized);

Description

Constructor that does not initialize any members.

Parameters

TUninitialized


TOpenFontCharMetrics()

IMPORT_C TOpenFontCharMetrics(const TCharacterMetrics &aMetrics);

Description

A constructor initialised with a TCharacterMetrics object.

This is the old-style character metrics object. As for other T classes, there is no need to explicitly cleanup TOpenFontCharMetrics objects.

Parameters

const TCharacterMetrics &aMetrics

The old-style metrics object.

[Top]


Member functions


GetTCharacterMetrics()

IMPORT_C TBool GetTCharacterMetrics(TCharacterMetrics &aMetrics) const;

Description

Converts a TCharacterMetrics object to a TOpenFontCharacterMetrics.

Parameters

TCharacterMetrics &aMetrics

On return, contains the character's old-style metrics.

Return value

TBool

ETrue if it was possible to get the metrics, otherwise EFalse.


Width()

inline TInt Width() const;

Description

Gets the width of the character's bitmap.

Return value

TInt

The width of the bitmap in pixels.


Height()

inline TInt Height() const;

Description

Gets the height of the character's bitmap.

Return value

TInt

The character's height in pixels.


HorizBearingX()

inline TInt HorizBearingX() const;

Description

Gets the horizontal bearing X.

This is the distance in pixels from the pen point before the character is drawn (the origin) to the left edge of the bitmap, when drawing horizontally. A positive value means that the left edge of the bitmap is right of the origin.

Return value

TInt

The horizontal bearing X in pixels


HorizBearingY()

inline TInt HorizBearingY() const;

Description

Gets horizontal bearing Y.

This is the vertical distance in pixels from the pen point before the character is drawn (the origin) to the top edge of the bitmap, when drawing horizontally. A positive value means that the top edge of the bitmap is above the origin

Return value

TInt

The horizontal bearing Y in pixels.


HorizAdvance()

inline TInt HorizAdvance() const;

Description

Gets the horizontal advance.

This is the amount added to the x co-ordinate of the origin after the character is drawn what most people understand by the width or escapement of a character. The origin here is the pen point before the character is drawn.

Return value

TInt

The horizontal advance in pixels


VertBearingX()

inline TInt VertBearingX() const;

Description

Gets the vertical bearing X.

This is the distance in pixels from the pen point before the character is drawn (the origin) to the left edge of the bitmap, when drawing vertically. A positive value means that the left edge of the bitmap is right of the origin.

Return value

TInt

The vertical bearing X in pixels.


VertBearingY()

inline TInt VertBearingY() const;

Description

Gets the vertical bearing Y.

This is the distance in pixels from the pen point before the character is drawn (the origin) to the top edge of the bitmap, when drawing vertically. A positive value means that the top edge of the bitmap is above the origin.

Return value

TInt

The vertical bearing Y in pixels.


VertAdvance()

inline TInt VertAdvance() const;

Description

Gets the vertical advance.

When drawing vertically, this is the amount added to the y co-ordinate of the origin after the character is drawn what most people understand by the height of a character. The origin here is the pen point before the character is drawn.

Note: Vertical drawing is not supported in v5.

Return value

TInt

The vertical advance in pixels.


GetHorizBounds()

inline void GetHorizBounds(TRect &aBounds) const;

Description

Gets the bounds of the character relative to its origin when setting text horizontally.

The origin here is the pen point before the character is drawn.

Parameters

TRect &aBounds

The character's bounds.


GetVertBounds()

inline void GetVertBounds(TRect &aBounds) const;

Description

Gets the bounds of the character relative to its origin when setting text vertically.

The origin here is the pen point before the character is drawn.

Parameters

TRect &aBounds

The character's bounds.


SetWidth()

inline void SetWidth(TInt aWidth);

Description

Sets the width of the character's bitmap.

Parameters

TInt aWidth

The width of the bitmap in pixels.


SetHeight()

inline void SetHeight(TInt aHeight);

Description

Sets the height of the character's bitmap.

Parameters

TInt aHeight

The character height (in pixels).


SetHorizBearingX()

inline void SetHorizBearingX(TInt aHorizBearingX);

Description

Sets the horizontal bearing X.

This is the distance in pixels from the pen point before the character is drawn (the origin) to the left edge of the bitmap, when drawing horizontally. A positive value means that the left edge of the bitmap is right of the origin.

Parameters

TInt aHorizBearingX

The horizontal bearing X (in pixels).


SetHorizBearingY()

inline void SetHorizBearingY(TInt aHorizBearingY);

Description

Sets the horizontal bearing Y.

This is the distance in pixels from the pen point before the character is drawn (the origin) to the top edge of the bitmap, when drawing horizontally. A positive value means that the top edge of the bitmap is above the origin.

Parameters

TInt aHorizBearingY

The horizontal bearing Y (in pixels).


SetHorizAdvance()

inline void SetHorizAdvance(TInt aHorizAdvance);

Description

Sets the horizontal advance.

This is the amount added to the x co-ordinate of the origin after the character is drawn, what most people understand by the width or escapement of a character. The origin here is the pen point before the character is drawn.

Parameters

TInt aHorizAdvance

The horizontal advance (in pixels).


SetVertBearingX()

inline void SetVertBearingX(TInt aVertBearingX);

Description

Set vertical bearing X.

This is the distance in pixels from the pen point before the character is drawn (the origin) to the left edge of the bitmap, when drawing vertically. A positive value means that the left edge of the bitmap is right of the origin.

Parameters

TInt aVertBearingX

The vertical bearing X (in pixels).


SetVertBearingY()

inline void SetVertBearingY(TInt aVertBearingY);

Description

Sets the vertical bearing Y.

This is the distance in pixels from the pen point before the character is drawn (the origin) to the top edge of the bitmap, when drawing vertically. A positive value means that the top edge of the bitmap is above the origin.

Parameters

TInt aVertBearingY

The vertical bearing Y (in pixels).


SetVertAdvance()

inline void SetVertAdvance(TInt aVertAdvance);

Description

Sets the vertical advance.

When drawing vertically, this is the amount added to the y co-ordinate of the origin after the character is drawn what most people understand by the height of a character. The origin here is the pen point before the character is drawn.

Note: Vertical drawing is not supported in v5.

Parameters

TInt aVertAdvance

The vertical advance (in pixels).

[Top]


Member enumerations


Enum TUninitialized

TUninitialized

Description

EUninitialized