![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section Contents
Applications that use this class will not work correctly on a version of EPOC earlier than ER5.
Not applicable.
openfont.h
fntstr.lib
Character metrics allow characters to be placed horizontally or vertically. This class defines the character metrics used in the Open Font System. In the descriptions below 'origin' means the pen point before the character is drawn.
Width |
width of the character bitmap in pixels |
Height |
height of the character bitmap in pixels |
HorizBearingX |
x distance in pixels from 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 |
y distance in pixels from 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 |
HorizAdvance |
amount added to the x coordinate of the origin after the character is drawn; what most people understand by the width of a character; also known as escapement. |
VertBearingX |
same as HorizBearingX, only used when drawing vertically |
VertBearingY |
same as HorizBearingY, only used when drawing vertically |
VertAdvance |
same as HorizAdvance, only used when drawing vertically |
Note : Vertical drawing (in the sense of characters drawn with horizontal baselines, but in a vertical line) is not yet supported by EPOC.
The constructor sets all data members to zero. A constructor can also be initialised with a TCharacterMetrics (old character metrics style) object. As for other T classes, there is no need to explicitly cleanup TOpenFontCharMetrics objects.
Metrics can be queried through a number of public functions. However, typically the exported function GetTCharacterMetrics() would be used.
The public query functions are:
TBool GetTCharacterMetrics(TCharacterMetrics& aMetrics) const;
Returns old-style character metrics from open system character definition
TCharacterMetrics& aMetrics |
aMetrics takes the old-style metrics of the character |
TBool |
Returns TRUE if it was possible to get the metrics |
TInt Width() const;
Returns the width of the characters bitmap in pixels
TInt |
width in pixels |
TInt Height() const;
Returns the height of the characters bitmap in pixels
TInt |
height in pixels |
TInt HorizBearingX() const;
Returns the horizontal 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
TInt |
horizontal bearing x in pixels |
TInt HorizBearingY() const;
Returns 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
TInt |
horizontal bearing y in pixels |
TInt HorizAdvance() const;
Returns 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.
TInt |
horizontal advance in pixels |
TInt VertBearingX() const;
Returns the horizontal 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
TInt |
vertical bearing X in pixels |
TInt VertBearingY() const;
Returns 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 vertically. A positive value means that the top edge of the bitmap is above the origin.
TInt |
vertical bearing Y in pixels |
TInt VertAdvance() const;
Returns the amount added to the y co-ordinate of the origin after the character is drawn. This is the escapement value used when drawing vertically; but note that this form of vertical drawing is not supported by EPOC Release 5.
TInt |
vertical advance in pixels |
Metrics can be modified through a number of public functions:
void SetWidth(TInt aWidth);
Sets character width (in pixels).
TInt aWidth |
character width (in pixels) |
void SetHeight(TInt aHeight);
Sets character height (in pixels).
TInt aHeight |
character height (in pixels) |
void SetHorizBearingX(TInt aHorizBearingX);
Set the horizontal bearing X (in pixels)
TInt aHorizBearingX |
horizontal bearing X (in pixels) |
void SetHorizBearingY(TInt aHorizBearingY);
Sets the horizontal bearing Y (in pixels)
TInt aHorizBearingY |
horizontal bearing Y (in pixels) |
void SetHorizAdvance(TInt aHorizAdvance);
Sets the horizontal advance attribute.
TInt aHorizAdvance |
horizontal advance (in pixels) |
void SetVertBearingX(TInt aVertBearingX);
Sets the vertical bearing X attribute.
TInt aVertBearingX |
vertical bearing X (in pixels) |
void SetVertBearingY(TInt aVertBearingY);
Set vertical bearing Y attribute.
TInt aVertBearingY |
vertical bearing Y (in pixels) |
void SetVertAdvance(TInt aVertAdvance);
Set vertical advance attribute.
TInt aVertAdvance |
vertical advance (in pixels) |
All data members are private. Access is via the public functions.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |