diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-04-29 13:53:39 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-05-04 05:46:25 +0000 |
commit | 7a18b7e2c2394b2b2cc95833c755f91193d9ba2e (patch) | |
tree | 0a4f1e1905ad0d36cb3e91fd49463e5d77f5e016 /src/gui/text/qfontengine_p.h | |
parent | b7e3a9e5044b91322b0a64af1d110d3966c71b6b (diff) |
Fix font height metrics with embedded bitmaps
For fonts with embedded bitmaps, we cannot trust the HHEA and
OS/2 tables, since there are a different set of font metrics
in the EBLC/CBLC tables for each of the predefined bitmap
sizes.
In this case, we can safely fall back to the metrics returned
by the system, as the inconsistency we were originally fixing
was only between OS/2 and HHEA and will not matter for the
bitmap fonts.
This patch also simplifies the code path through the font
engines a bit. Instead of setting the system metrics in the
processHheaTable() function when the table cannot be found,
we instead always fetch the system metrics at the very start
of initializeHeightMetrics() and then override if there are
no embedded bitmaps, and if the HHEA and OS/2 tables are
available. This also reduces the number of virtual functions
needed to sort out the height metrics.
Fixes: QTBUG-83754
Change-Id: Ib9dc6fc6cf972e48209a4a272469d2b4bd1ebffe
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/gui/text/qfontengine_p.h')
-rw-r--r-- | src/gui/text/qfontengine_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 50f3948311..cbfc985eec 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -375,8 +375,8 @@ protected: mutable bool m_heightMetricsQueried; virtual void initializeHeightMetrics() const; - virtual bool processHheaTable() const; - virtual bool processOS2Table() const; + bool processHheaTable() const; + bool processOS2Table() const; private: struct GlyphCacheEntry { |