Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: openfont.h
Link against: fntstr.lib

Class TOpenFontCharMetrics

TOpenFontCharMetrics

Support

Supported from 5.0

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 :

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

See also:


Construction and destruction


TOpenFontCharMetrics()

TOpenFontCharMetrics();

Description

Default C++ constructor.

The constructor initialises all data members to zero. As for other T classes, there is no need to explicitly cleanup TOpenFontCharMetrics objects.


TOpenFontCharMetrics()

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()

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.


GetHorizBounds()

void GetHorizBounds(TRect& aBounds) const;

Support

Supported from 6.0

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()

void GetVertBounds(TRect& aBounds) const;

Support

Supported from 6.0

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.


Height()

TInt Height() const;

Description

Gets the height of the character's bitmap.

Return value

TInt

The character's height in pixels.


HorizAdvance()

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


HorizBearingX()

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()

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.


VertAdvance()

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:

Return value

TInt

The vertical advance in pixels.


VertBearingY()

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.


VertBearingX()

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.


Width()

TInt Width() const;

Description

Gets the width of the character's bitmap.

Return value

TInt

The width of the bitmap in pixels.


SetHeight()

void SetHeight(TInt aHeight);

Description

Sets the height of the character's bitmap.

Parameters

TInt aHeight

The character height (in pixels).


SetHorizAdvance()

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


SetHorizBearingX()

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()

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


SetVertAdvance()

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:

Parameters

TInt aVertAdvance

The vertical advance (in pixels).


SetVertBearingX()

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()

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


SetWidth()

void SetWidth(TInt aWidth);

Description

Sets the width of the character's bitmap.

Parameters

TInt aWidth

The width of the bitmap in pixels.