diff options
author | Jian Liang <jianliang79@gmail.com> | 2016-04-28 22:14:20 +0800 |
---|---|---|
committer | jian liang <jianliang79@gmail.com> | 2016-04-29 09:10:32 +0000 |
commit | d2304a28ca657634253af26ad803c7f292e6f4cc (patch) | |
tree | fbd8db9f837e6988f5b74852a2e875d1619ab064 | |
parent | c8e4d15004bade8b99aaf74b6f899911b5d66962 (diff) |
Change some members of QFontEngineFT::Glyph to short
Some color bitmap fonts will have a size greater than 127 pixels,
areMetricsTooLarge() will return true(its advance exceed 127) for
these fonts and we are unable to render these fonts since
QFontEngineFT::loadGlyph() will simply do nothing if
areMetricsTooLarge() return true. To support bitmap font whose size
is between 128 and 255, we change x,y,advance of QFontEngineFT::Glyph
to short variable to make areMetricsTooLarge() return false, in this
way we will be able to render such color bitmap fonts.
Change-Id: I9ab244b14884cdde91040a462f2fbca650b91289
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 5 | ||||
-rw-r--r-- | src/gui/text/qfontengine_ft_p.h | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 86fb0e8ae4..ec995d5cc6 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -849,11 +849,8 @@ static inline bool areMetricsTooLarge(const QFontEngineFT::GlyphInfo &info) { // false if exceeds QFontEngineFT::Glyph metrics return (short)(info.linearAdvance) != info.linearAdvance - || (signed char)(info.xOff) != info.xOff || (uchar)(info.width) != info.width - || (uchar)(info.height) != info.height - || (signed char)(info.x) != info.x - || (signed char)(info.y) != info.y; + || (uchar)(info.height) != info.height; } QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 3421c873d5..ee2df6f665 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -140,9 +140,9 @@ public: short linearAdvance; unsigned char width; unsigned char height; - signed char x; - signed char y; - signed char advance; + short x; + short y; + short advance; signed char format; uchar *data; }; |