From a56ee60791538e5442b3d97b75270b25dc4986db Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 16 May 2012 18:14:45 +0200 Subject: Fix FreeType glyph caching for high resolution For high resolution or extremely large font sizes, the advance cached here is likely to overflow, since FreeType returns 26.6 fixed point value and we only take signed char here for advance. In those cases we should skip caching because there won't be that many big glyphs after all. Also move the metrics caching block a bit down to take glyph embolden and oblique into account. As a result we also don't need to increase the linearAdvance size because any linearAdvance less than 128 should fit in the old 10.6 fixed format. Change-Id: Ic4920ada49954ce1e0a8673c9f33f30e385e3046 Reviewed-by: Friedemann Kleint Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengine_ft_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/text/qfontengine_ft_p.h') diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index e665ce8a09..5abcadc2dc 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -141,7 +141,7 @@ public: /* we don't cache glyphs that are too large anyway, so we can make this struct rather small */ struct Glyph { ~Glyph(); - int linearAdvance : 22; // 16.6 + short linearAdvance; unsigned char width; unsigned char height; signed char x; -- cgit v1.2.3