diff options
Diffstat (limited to 'src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm')
-rw-r--r-- | src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index 339212db25..646212124b 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -378,6 +378,19 @@ QFixed QCoreTextFontEngine::ascent() const ? QFixed::fromReal(CTFontGetAscent(ctfont)).round() : QFixed::fromReal(CTFontGetAscent(ctfont)); } + +QFixed QCoreTextFontEngine::capHeight() const +{ + QFixed c = QFixed::fromReal(CTFontGetCapHeight(ctfont)); + if (c <= 0) + return calculatedCapHeight(); + + if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) + c = c.round(); + + return c; +} + QFixed QCoreTextFontEngine::descent() const { QFixed d = QFixed::fromReal(CTFontGetDescent(ctfont)); |