summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm6
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index db26209b2b..400a5ea805 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -216,6 +216,7 @@ void QCoreTextFontEngine::init()
avgCharWidth = QFontEngine::averageCharWidth();
underlineThickness = QFixed::fromReal(CTFontGetUnderlineThickness(ctfont));
+ underlinePos = -QFixed::fromReal(CTFontGetUnderlinePosition(ctfont));
cache_cost = (CTFontGetAscent(ctfont) + CTFontGetDescent(ctfont)) * avgCharWidth.toInt() * 2000;
@@ -764,6 +765,11 @@ QFixed QCoreTextFontEngine::lineThickness() const
return underlineThickness;
}
+QFixed QCoreTextFontEngine::underlinePosition() const
+{
+ return underlinePos;
+}
+
QFontEngine::Properties QCoreTextFontEngine::properties() const
{
Properties result;
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
index 4ad062b699..5681347931 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
@@ -93,6 +93,7 @@ public:
bool supportsSubPixelPositions() const Q_DECL_OVERRIDE { return true; }
QFixed lineThickness() const Q_DECL_OVERRIDE;
+ QFixed underlinePosition() const Q_DECL_OVERRIDE;
void draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt &ti, int paintDeviceHeight);
@@ -143,6 +144,7 @@ private:
CGAffineTransform transform;
QFixed avgCharWidth;
QFixed underlineThickness;
+ QFixed underlinePos;
QFontEngine::FaceId face_id;
mutable bool kerningPairsLoaded;
};