TOpenFontCharMetrics Class Reference

class TOpenFontCharMetrics

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.

CFont::GetCharacterData() CFbsFont::GetCharacterData()

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.

Parameters

TUninitialized

TOpenFontCharMetrics(const TCharacterMetrics &)

IMPORT_CTOpenFontCharMetrics(const TCharacterMetrics &aMetrics)

Parameters

const TCharacterMetrics & aMetrics

Member Functions 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.

Parameters

TRect & aBoundsThe character's bounds.

GetTCharacterMetrics(TCharacterMetrics &)

IMPORT_C TBoolGetTCharacterMetrics(TCharacterMetrics &aMetrics)const

Parameters

TCharacterMetrics & aMetrics

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.

Parameters

TRect & aBoundsThe character's bounds.

GlyphType()

IMPORT_C TGlyphBitmapTypeGlyphType()const

Height()

TInt Height()const [inline]

Gets the height of the character's bitmap.

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.

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.

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

SetGlyphType(TGlyphBitmapType)

IMPORT_C voidSetGlyphType(TGlyphBitmapType)

Parameters

TGlyphBitmapType

SetHeight(TInt)

voidSetHeight(TIntaHeight)[inline]

Sets the height of the character's bitmap.

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

TInt aVertBearingYThe vertical bearing Y (in pixels).

SetWidth(TInt)

voidSetWidth(TIntaWidth)[inline]

Sets the width of the character's bitmap.

Parameters

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

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.

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.

Width()

TInt Width()const [inline]

Gets the width of the character's bitmap.

Member Enumerations Documentation

Enum TUninitialized

Enumerators

EUninitialized

Member Data Documentation

TUint16 iGlyphBitmapType

TUint16 iGlyphBitmapType[private]

TInt16 iHeight

TInt16 iHeight[private]

TInt16 iHorizAdvance

TInt16 iHorizAdvance[private]

TInt16 iHorizBearingX

TInt16 iHorizBearingX[private]

TInt16 iHorizBearingY

TInt16 iHorizBearingY[private]

TInt16 iReserved

TInt16 iReserved[private]

TInt16 iVertAdvance

TInt16 iVertAdvance[private]

TInt16 iVertBearingX

TInt16 iVertBearingX[private]

TInt16 iVertBearingY

TInt16 iVertBearingY[private]

TInt16 iWidth

TInt16 iWidth[private]