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_C TOpenFontCharMetrics ( const TCharacterMetrics & aMetrics )

Parameters

const TCharacterMetrics & aMetrics

Member Functions Documentation

GetHorizBounds(TRect &)

void GetHorizBounds ( 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 & aBounds The character's bounds.

GetTCharacterMetrics(TCharacterMetrics &)

IMPORT_C TBool GetTCharacterMetrics ( TCharacterMetrics & aMetrics ) const

Parameters

TCharacterMetrics & aMetrics

GetVertBounds(TRect &)

void GetVertBounds ( 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 & aBounds The character's bounds.

GlyphType()

IMPORT_C TGlyphBitmapType GlyphType ( ) 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 void SetGlyphType ( TGlyphBitmapType )

SetHeight(TInt)

void SetHeight ( TInt aHeight ) [inline]

Sets the height of the character's bitmap.

Parameters

TInt aHeight The character height (in pixels).

SetHorizAdvance(TInt)

void SetHorizAdvance ( TInt aHorizAdvance ) [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 aHorizAdvance The horizontal advance (in pixels).

SetHorizBearingX(TInt)

void SetHorizBearingX ( TInt aHorizBearingX ) [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 aHorizBearingX The horizontal bearing X (in pixels).

SetHorizBearingY(TInt)

void SetHorizBearingY ( TInt aHorizBearingY ) [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 aHorizBearingY The horizontal bearing Y (in pixels).

SetVertAdvance(TInt)

void SetVertAdvance ( TInt aVertAdvance ) [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 aVertAdvance The vertical advance (in pixels).

SetVertBearingX(TInt)

void SetVertBearingX ( TInt aVertBearingX ) [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 aVertBearingX The vertical bearing X (in pixels).

SetVertBearingY(TInt)

void SetVertBearingY ( TInt aVertBearingY ) [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 aVertBearingY The vertical bearing Y (in pixels).

SetWidth(TInt)

void SetWidth ( TInt aWidth ) [inline]

Sets the width of the character's bitmap.

Parameters

TInt aWidth The 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]