From 49c971c8eb096f6ce3dde397c37c0d49631e5ab6 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 26 Jul 2008 10:21:26 +0000 Subject: (svn r13832) -Fix [FS#2152]: FreeType may return a bitmap glyph even if a grey-scale glyph was requested. --- src/fontcache.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/fontcache.cpp') diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 0135c2567..ab7c9c5d1 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -415,6 +415,9 @@ const Sprite *GetGlyph(FontSize size, WChar key) FT_Load_Char(face, key, FT_LOAD_DEFAULT); FT_Render_Glyph(face->glyph, aa ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO); + /* Despite requesting a normal glyph, FreeType may have returned a bitmap */ + aa = (slot->bitmap.palette_mode == FT_PIXEL_MODE_GRAY); + /* Add 1 pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel */ width = max(1, slot->bitmap.width + (size == FS_NORMAL)); height = max(1, slot->bitmap.rows + (size == FS_NORMAL)); -- cgit v1.2.3-54-g00ecf