path: root/src/gui/text/qfontengine_ft_p.h
diff options
authorAllan Sandfeld Jensen <>2014-08-25 12:56:34 +0200
committerAllan Sandfeld Jensen <>2014-09-01 12:25:56 +0200
commit367680679ae13faaf71aa481265cb93629a36427 (patch)
treeb5d61cf342525c951041f586273c5202d69c12e3 /src/gui/text/qfontengine_ft_p.h
parent1812bb968c49d50745ab2b10787320205c54f946 (diff)
Fix advance of zero-width spaces in fonts that omits the glyph
Some fonts appear to include zero-width space in the CMAP table, but not include an actual definitions of the glyph they point to. The missing glyph causes a warning, but isn't handled making the character end up being giving the same metrics as whatever character it came after. This patch adds explicit handling of missing glyphs, and also caches their missing state when caching is enabled. Task-number: QTBUG-40912 Change-Id: I06fba9c01df59548e750e36babfdd5a6bafd6bd0 Reviewed-by: Konstantin Ritt <> Reviewed-by: Pierre Rossi <>
Diffstat (limited to 'src/gui/text/qfontengine_ft_p.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 09c70c5083..e23024e472 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -187,8 +187,11 @@ public:
inline Glyph *getGlyph(glyph_t index, QFixed subPixelPosition = 0) const;
void setGlyph(glyph_t index, QFixed spp, Glyph *glyph);
+ inline bool isGlyphMissing(glyph_t index) const { return missing_glyphs.contains(index); }
+ inline void setGlyphMissing(glyph_t index) const { missing_glyphs.insert(index); }
mutable QHash<GlyphAndSubPixelPosition, Glyph *> glyph_data; // maps from glyph index to glyph data
+ mutable QSet<glyph_t> missing_glyphs;
mutable Glyph *fast_glyph_data[256]; // for fast lookup of glyphs < 256
mutable int fast_glyph_count;