TOpenFontCharMetrics Class Reference

#include <openfont.h>

Link against: fntstr.lib

class TOpenFontCharMetrics

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

See also: CFont::GetCharacterData() CFbsFont::GetCharacterData()

Member Enumeration Documentation

Enum TUninitialized

EnumeratorValueDescription
EUninitialized

Constructor & Destructor Documentation

TOpenFontCharMetrics ( )

TOpenFontCharMetrics()[inline]

Default constructor initializes all members to 0.

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

TOpenFontCharMetrics(TUninitialized)[inline]

Constructor that does not initialize any members.

TOpenFontCharMetrics ( const TCharacterMetrics & )

IMPORT_CTOpenFontCharMetrics(const TCharacterMetrics &aMetrics)

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.

ParameterDescription
aMetricsThe old-style metrics object.

Member Function Documentation

GetHorizBounds ( TRect & )

voidGetHorizBounds(TRect &aBounds)const [inline]

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.

ParameterDescription
aBoundsThe character's bounds.

GetTCharacterMetrics ( TCharacterMetrics & )

IMPORT_C TBoolGetTCharacterMetrics(TCharacterMetrics &aMetrics)const

Converts a TOpenFontCharacterMetrics object to a TCharacterMetrics.

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

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

GetVertBounds ( TRect & )

voidGetVertBounds(TRect &aBounds)const [inline]

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.

ParameterDescription
aBoundsThe character's bounds.

GlyphType ( )

IMPORT_C TGlyphBitmapTypeGlyphType()const

Gets the glyph bitmap type.

Height ( )

TInt Height()const [inline]

Gets the height of the character's bitmap.

Returns: The character's height in pixels.

HorizAdvance ( )

TInt HorizAdvance()const [inline]

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.

Returns: The horizontal advance in pixels

HorizBearingX ( )

TInt HorizBearingX()const [inline]

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.

Returns: The horizontal bearing X in pixels

HorizBearingY ( )

TInt HorizBearingY()const [inline]

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

Returns: The horizontal bearing Y in pixels.

SetGlyphType ( TGlyphBitmapType )

IMPORT_C voidSetGlyphType(TGlyphBitmapType)

Sets the glyph bitmap type.

Normally the bitmap type belongs to the font, but for linked fonts this can be different between different font elements making up the linked font.

Note: This is only of use in conjunction with rasterizer based linked fonts.

SetHeight ( TInt )

voidSetHeight(TIntaHeight)[inline]

Sets the height of the character's bitmap.

ParameterDescription
aHeightThe character height (in pixels).

SetHorizAdvance ( TInt )

voidSetHorizAdvance(TIntaHorizAdvance)[inline]

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.

ParameterDescription
aHorizAdvanceThe horizontal advance (in pixels).

SetHorizBearingX ( TInt )

voidSetHorizBearingX(TIntaHorizBearingX)[inline]

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.

ParameterDescription
aHorizBearingXThe horizontal bearing X (in pixels).

SetHorizBearingY ( TInt )

voidSetHorizBearingY(TIntaHorizBearingY)[inline]

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.

ParameterDescription
aHorizBearingYThe horizontal bearing Y (in pixels).

SetVertAdvance ( TInt )

voidSetVertAdvance(TIntaVertAdvance)[inline]

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.

ParameterDescription
aVertAdvanceThe vertical advance (in pixels).

SetVertBearingX ( TInt )

voidSetVertBearingX(TIntaVertBearingX)[inline]

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.

ParameterDescription
aVertBearingXThe vertical bearing X (in pixels).

SetVertBearingY ( TInt )

voidSetVertBearingY(TIntaVertBearingY)[inline]

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.

ParameterDescription
aVertBearingYThe vertical bearing Y (in pixels).

SetWidth ( TInt )

voidSetWidth(TIntaWidth)[inline]

Sets the width of the character's bitmap.

ParameterDescription
aWidthThe width of the bitmap in pixels.

VertAdvance ( )

TInt VertAdvance()const [inline]

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.

Returns: The vertical advance in pixels.

VertBearingX ( )

TInt VertBearingX()const [inline]

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.

Returns: The vertical bearing X in pixels.

VertBearingY ( )

TInt VertBearingY()const [inline]

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.

Returns: The vertical bearing Y in pixels.

Width ( )

TInt Width()const [inline]

Gets the width of the character's bitmap.

Returns: The width of the bitmap in pixels.