summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_qpf2.cpp
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-03 15:45:02 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2016-08-15 18:27:06 +0000
commitac1e87d9f373ad649d989f254b37d2f29ddf25fe (patch)
treeb39d2a1c3d207fd2f025301a4908c472c95245a4 /src/gui/text/qfontengine_qpf2.cpp
parent869513a49f7902b5942e439a972807583dab9bf9 (diff)
Added capHeight() to QRawFont and QFontMetrics(F)
Cap height is an important metric of font, in particular it is required to make decent implementation of "initial-letter" CSS property in QtWebKit. Note that some fonts lack cap height metadata, so we need to fall back to measuring H letter height. Change-Id: Icf69d92159d070889085e20d31f2e397d796d940 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/text/qfontengine_qpf2.cpp')
-rw-r--r--src/gui/text/qfontengine_qpf2.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_qpf2.cpp b/src/gui/text/qfontengine_qpf2.cpp
index 2e4af09550..110d512d39 100644
--- a/src/gui/text/qfontengine_qpf2.cpp
+++ b/src/gui/text/qfontengine_qpf2.cpp
@@ -459,6 +459,11 @@ QFixed QFontEngineQPF2::ascent() const
return QFixed::fromReal(extractHeaderField(fontData, Tag_Ascent).value<qreal>());
}
+QFixed QFontEngineQPF2::capHeight() const
+{
+ return calculatedCapHeight();
+}
+
QFixed QFontEngineQPF2::descent() const
{
return QFixed::fromReal(extractHeaderField(fontData, Tag_Descent).value<qreal>());