summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-12-10 09:18:34 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-12-10 23:15:39 +0100
commitb00404abffdc423c00e35ba53ca6a8bdfa91b51d (patch)
tree6141735c15ca24672a171ede857e6d0589d36d3e /src/gui/text
parent6a42363febb12c73c5cfe4df55f85bc651b4b8bf (diff)
Trust CoreText-provided vertical metrics on macOS
In f761ad3cd9ad1252f24b76ae413298dc7bed8af3 we added a cross-platform consistent approach to vertical spacing of text. However, this has created problem on macOS, as some of the default fonts on the system have inconsistent metrics. Specifically, Monaco is missing the typographical metrics flag in its OS/2 table, and the alternative metrics in the table are about 30% larger than the typographical metrics (which match what is used natively). As a result, the fonts look the same on macOS as on other platforms now, but different from when the same fonts are used in native apps. We can't have fonts look wrong on their native platform, so we revert this change for CoreText, trusting the metrics we get from the system instead. We keep the consistent approach for the FreeType engine, as its main use case is cross-platform consistent text rendering. [ChangeLog][macOS][Text] Fixed an issue where certain fonts, such as Monaco, would have a different line spacing than expected. Pick-to: 6.2 Fixes: QTBUG-97818 Change-Id: I0a3dbe4636d67779935e645066b1e51c1517dc6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/coretext/qfontengine_coretext.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/coretext/qfontengine_coretext.mm b/src/gui/text/coretext/qfontengine_coretext.mm
index d1b13f73e9..276c0d589e 100644
--- a/src/gui/text/coretext/qfontengine_coretext.mm
+++ b/src/gui/text/coretext/qfontengine_coretext.mm
@@ -371,7 +371,7 @@ void QCoreTextFontEngine::initializeHeightMetrics() const
m_descent = QFixed::fromReal(CTFontGetDescent(ctfont));
m_leading = QFixed::fromReal(CTFontGetLeading(ctfont));
- QFontEngine::initializeHeightMetrics();
+ m_heightMetricsQueried = true;
}
QFixed QCoreTextFontEngine::capHeight() const