diff options
-rw-r--r-- | src/gui/text/qtextformat.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 06ae00123f0..379fb70a81a 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -2245,6 +2245,17 @@ void QTextCharFormat::setFont(const QFont &font, FontPropertiesInheritanceBehavi /*! Returns the font for this character format. + + This function takes into account the format's font attributes (such as fontWeight() + and fontPointSize()) and resolves them on top of the default font, defined as follows. + If the format is part of a document, that is the document's default font. + Otherwise the properties are resolved on top of a default constructed QFont. + + For example, if this format's font size hasn't been changed from the default font, + fontPointSize() returns 0, while \c {font().pointSize()} returns the actual + size used for drawing. + + \sa QTextDocument::defaultFont() */ QFont QTextCharFormat::font() const { |