Qt Components Hildon  0.20
QML components for Maemo5 with Hildon styling.
 All Classes Functions Properties Groups Pages
Public Slots | Properties | List of all members
FontMetrics Class Reference

Provides metrics for a given font. More...

Public Slots

int advanceWidth (string text)
 Returns the advance in pixels of the characters in text.
rect boundingRect (string text)
 Returns the bounding rectangle of the characters in the string specified by text.
rect tightBoundingRect (string text)
 Returns a tight bounding rectangle around the characters in the string specified by text.

Properties

int ascent
 The ascent of the font.
int averageCharacterWidth
 The average width of glyphs in the font.
int descent
 The descent of the font.
font font
 The font used for the metrics calculations.
int height
 The height of the font.
int leading
 The leading of the font.
int lineSpacing
 The distance from one base line to the next.
int lineWidth
 The width of the underline and strikeout lines, adjusted for the point size of the font.
int maximumCharacterWidth
 The width of the widest character in the font.
int minimumLeftBearing
 The minimum left bearing of the font.
int minimumRightBearing
 The minimum right bearing of the font.
int overlinePosition
 The distance from the base line to where an overline should be drawn.
int strikeOutPosition
 The distance from the base line to where the strikeout line should be drawn.
int underlinePosition
 The distance from the base line to where an underscore should be drawn.
int xHeight
 The 'x' height of the font.

Detailed Description

Provides metrics for a given font.

FontMetrics calculates the size of characters and strings for a given font.

It provides a subset of the C++ QFontMetrics API, with the added ability to change the font that is used for calculations via the font property.

See Also
TextMetrics

Member Function Documentation

int FontMetrics::advanceWidth ( string  text)
slot

Returns the advance in pixels of the characters in text.

This is the distance from the position of the string to where the next string should be drawn.

See Also
TextMetrics::advanceWidth
rect FontMetrics::boundingRect ( string  text)
slot

Returns the bounding rectangle of the characters in the string specified by text.

See Also
TextMetrics::boundingRect
rect FontMetrics::tightBoundingRect ( string  text)
slot

Returns a tight bounding rectangle around the characters in the string specified by text.

See Also
TextMetrics::tightBoundingRect

Property Documentation

int FontMetrics::ascent
read

The ascent of the font.

See Also
descent, height
int FontMetrics::descent
read

The descent of the font.

See Also
ascent, height
int FontMetrics::overlinePosition
read

The distance from the base line to where an overline should be drawn.

See Also
strikeOutPosition, underlinePosition
int FontMetrics::strikeOutPosition
read

The distance from the base line to where the strikeout line should be drawn.

See Also
overlinePosition, underlinePosition
int FontMetrics::underlinePosition
read

The distance from the base line to where an underscore should be drawn.

See Also
overlinePosition, strikeOutPosition