summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoni Poikelin <joni.poikelin@qt.io>2018-01-22 18:51:57 +0200
committerJoni Poikelin <joni.poikelin@qt.io>2018-02-02 12:54:04 +0000
commitb7e436738756b1d5d7a45201b7a7204d7fe128a1 (patch)
tree1860a91eeb370b10677cb1813752739361011015 /src
parent1f0c22844811d71fae69ee6b103bbfc5e750ca90 (diff)
Fix some cases of scaled text disappearing with freetype
Commit a56ee60791538e5442b3d97b75270b25dc4986db changed type of advance to short, restoring this fixes at least some cases where glyphs were disappearing. Task-number: QTBUG-65838 Change-Id: I33b252d91fb7541eaea3275b1950a048941869a6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp4
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 2c5850b6ad..3f543755b6 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -994,9 +994,7 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
static inline bool areMetricsTooLarge(const QFontEngineFT::GlyphInfo &info)
{
// false if exceeds QFontEngineFT::Glyph metrics
- return (short)(info.linearAdvance) != info.linearAdvance
- || (uchar)(info.width) != info.width
- || (uchar)(info.height) != info.height;
+ return info.width > 0xFF || info.height > 0xFF;
}
static inline void transformBoundingBox(int *left, int *top, int *right, int *bottom, FT_Matrix *matrix)
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
index c063f5df30..e98268ae4b 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
@@ -133,7 +133,7 @@ public:
/* we don't cache glyphs that are too large anyway, so we can make this struct rather small */
struct Glyph {
~Glyph();
- short linearAdvance;
+ int linearAdvance : 22;
unsigned char width;
unsigned char height;
short x;