diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 82491f06..39794d37 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -47,6 +47,7 @@ Please report any bugs and incompatibilities in This bug may generate dirty dots for monobitmap glyph from TTF. 1. Skip null pixels for SUBPIXEL glyphs. This bug will always show background pixels of one SUBPIXEL glyph. + 1. Fix the bug of wrong bounding box handling for SUBPIXEL rendering of glyph. * TUNNING: 1. Tune GLYPHINFO structure and GetGlyphInfo to return BIDI glyph type. diff --git a/src/font/freetype2.c b/src/font/freetype2.c index 067acff0..2bad2a5b 100644 --- a/src/font/freetype2.c +++ b/src/font/freetype2.c @@ -397,11 +397,11 @@ get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont, FT_Glyph_Get_CBox (ft_inst_info->glyph, ft_glyph_bbox_pixels, &bbox); -#if 1 //Note: using subpixel filter, the bbox_w is 2 pixel wider than normal. - if (IS_SUBPIXEL(logfont) && (ft_inst_info->ft_lcdfilter != FT_LCD_FILTER_NONE)) - bbox.xMax += 2; -#endif + if (IS_SUBPIXEL(logfont) && (ft_inst_info->ft_lcdfilter != FT_LCD_FILTER_NONE)) { + bbox.xMin -= 1; + bbox.xMax += 1; + } /* We just save the BBOX :). */ memcpy (&ft_inst_info->bbox, &bbox, sizeof(FT_BBox));