From ac1e87d9f373ad649d989f254b37d2f29ddf25fe Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Wed, 3 Aug 2016 15:45:02 +0300 Subject: 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 --- src/gui/text/qfontmetrics.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/text/qfontmetrics.h') diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h index 22e51f29f7..3eac309092 100644 --- a/src/gui/text/qfontmetrics.h +++ b/src/gui/text/qfontmetrics.h @@ -73,6 +73,7 @@ public: { qSwap(d, other.d); } int ascent() const; + int capHeight() const; int descent() const; int height() const; int leading() const; @@ -146,6 +147,7 @@ public: void swap(QFontMetricsF &other) { qSwap(d, other.d); } qreal ascent() const; + qreal capHeight() const; qreal descent() const; qreal height() const; qreal leading() const; -- cgit v1.2.3