fix the bug of wrong bbox handling for SUBPIXEL rendering of glyph

This commit is contained in:
Vincent Wei
2019-01-15 14:53:57 +08:00
parent c975fe5b8d
commit 16287af2a6
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -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.
+4 -4
View File
@@ -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));