summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qrawfont.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qrawfont.cpp')
-rw-r--r--src/gui/text/qrawfont.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index eadb65959a..8e6ffa5e94 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -325,6 +325,23 @@ qreal QRawFont::ascent() const
}
/*!
+ Returns the cap height of this QRawFont in pixel units.
+
+ \since 5.8
+
+ The cap height of a font is the height of a capital letter above
+ the baseline. It specifically is the height of capital letters
+ that are flat - such as H or I - as opposed to round letters such
+ as O, or pointed letters like A, both of which may display overshoot.
+
+ \sa QFontMetricsF::capHeight()
+*/
+qreal QRawFont::capHeight() const
+{
+ return d->isValid() ? d->fontEngine->capHeight().toReal() : 0.0;
+}
+
+/*!
Returns the descent of this QRawFont in pixel units.
\sa QFontMetricsF::descent()