summaryrefslogtreecommitdiffstats
path: root/.gitignore
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-12-06 07:13:28 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-04-22 16:18:57 +0200
commitf761ad3cd9ad1252f24b76ae413298dc7bed8af3 (patch)
tree0cdce90553fc85a773f3255c27024c41d1236f24 /.gitignore
parent7d8093df55f0bf76465add4ceb3732286971d849 (diff)
Use consistent vertical metrics on all platforms
Qt assumes that ascent+descent is the bounding height of the text, but for historical reasons, the ascent for some fonts will not contain the diacritics. On Windows, the preference is to use data from the OS/2 table which were explicitly invented to work around this, but on other platforms we are not respecting this table. This causes a text layout that looks fine on Windows to have overlapping characters on e.g. macOS. To make vertical metrics (ascent, descent, leading) consistent across all platforms, we don't blindly trust the values we get from the underlying font system, but apply in the following order: 1. If OS/2 table exists and USE_TYPO_METRICS flag is set, we use the typo metrics from OS/2 table 2. If OS/2 table exists and USE_TYPO_METRICS flag is not set, we use winAscent/winDescent from OS/2 and the line gap from HHEA table. 3. If no OS/2 table exists, we try to get ascent, descent and line gap from the HHEA table. 4. If the HHEA table does not exist (not an SFNT), we fall back to the system-provided metrics. (on macOS, we know the system-provided metrics will match the data in HHEA, so we skip parsing that table and use the data from CoreText if there is no OS/2 table). Task-number: QTBUG-80554 Change-Id: I41e6561a99513698c8e42451b4ec98bd5eb6892f Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions