diff options
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontmetrics.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 7997f643ab..7e6af54a56 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -75,11 +75,19 @@ extern void qt_format_text(const QFont& font, const QRectF &_r, inFont(). You can also treat the character as a string, and use the string functions on it. - The string functions include horizontalAdvance(), to return the width of a - string in pixels (or points, for a printer), boundingRect(), to - return a rectangle large enough to contain the rendered string, + The string functions include horizontalAdvance(), to return the advance + width of a string in pixels (or points, for a printer), boundingRect(), + to return a rectangle large enough to contain the rendered string, and size(), to return the size of that rectangle. + \note The advance width can be different from the width of the actual + rendered text. It refers to the distance from the origin of the string to + where you would append additional characters. As text may have overhang + (in the case of an italic font for instance) or padding between + characters, the advance width can be either smaller or larger than the + actual rendering of the text. This is called the right bearing of the + text. + Example: \snippet code/src_gui_text_qfontmetrics.cpp 0 |