diff --git a/src/font/freetype2.c b/src/font/freetype2.c index 587e2fd4..eb4aae1d 100644 --- a/src/font/freetype2.c +++ b/src/font/freetype2.c @@ -406,12 +406,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; + bbox.xMin -= 1; + bbox.xMax += 1; } -#endif /* We just save the BBOX :). */ memcpy (&ft_inst_info->bbox, &bbox, sizeof(FT_BBox)); @@ -655,7 +654,6 @@ get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont, FT_Fixed advance; FTINSTANCEINFO* ft_inst_info = FT_INST_INFO_P (devfont); - if (ft_inst_info->use_kerning && ft_inst_info->prev_index && ft_inst_info->cur_index) { if (ft_inst_info->is_index_old) { diff --git a/src/newgdi/glyph.c b/src/newgdi/glyph.c index 69b03c5f..23ae0378 100644 --- a/src/newgdi/glyph.c +++ b/src/newgdi/glyph.c @@ -2861,36 +2861,16 @@ int _gdi_draw_one_glyph (PDC pdc, Glyph32 glyph_value, BOOL direction, fg_gal_rc.w = bbox.w + italic; fg_gal_rc.h = bbox.h; -#if 0 // VincentWei: use FS_DECORATE_XXXX instead (3.4.0) - if ( pdc->bkmode != BM_TRANSPARENT - || logfont->style & FS_UNDERLINE_LINE - || logfont->style & FS_STRUCKOUT_LINE ) -#else if (pdc->bkmode != BM_TRANSPARENT || logfont->style & FS_DECORATE_UNDERLINE || logfont->style & FS_DECORATE_STRUCKOUT) -#endif need_rc_back = TRUE; -#if 0 // VincentWei: use FS_RENDER_MASK instead (3.4.0) - if (glyph_bmptype == DEVFONTGLYPHTYPE_MONOBMP) { - if (logfont->style & FS_WEIGHT_BOOK_LIGHT) { - fg_gal_rc.x--; fg_gal_rc.y--; - fg_gal_rc.w += 2; fg_gal_rc.h += 2; -// *adv_x += 1; -// advance += 1; - } - } -#else if (glyph_bmptype == DEVFONTGLYPHTYPE_MONOBMP && (logfont->style & FS_RENDER_MASK) == FS_RENDER_OUTLINE) { fg_gal_rc.x--; fg_gal_rc.y--; fg_gal_rc.w += 2; fg_gal_rc.h += 2; } - else if (glyph_bmptype == DEVFONTGLYPHTYPE_SUBPIXEL) { - fg_gal_rc.w += 2; - } -#endif if (need_rc_back) { if (direction) @@ -2900,23 +2880,11 @@ int _gdi_draw_one_glyph (PDC pdc, Glyph32 glyph_value, BOOL direction, make_back_area(pdc, x+*adv_x, y+*adv_y, x, y, area, &bg_gal_rc, &flag); -#if 0 // VincentWei: use FS_RENDER_MASK instead (3.4.0) - if (glyph_bmptype == DEVFONTGLYPHTYPE_MONOBMP) { - if (logfont->style & FS_WEIGHT_BOOK_LIGHT) { - bg_gal_rc.x--; bg_gal_rc.y--; - bg_gal_rc.w += 2; bg_gal_rc.h += 2; - } - } -#else if (glyph_bmptype == DEVFONTGLYPHTYPE_MONOBMP && (logfont->style & FS_RENDER_MASK) == FS_RENDER_OUTLINE) { bg_gal_rc.x--; bg_gal_rc.y--; bg_gal_rc.w += 2; bg_gal_rc.h += 2; } - else if (glyph_bmptype == DEVFONTGLYPHTYPE_SUBPIXEL) { - bg_gal_rc.w += 2; - } -#endif make_back_rect(&rc_back, area, &bg_gal_rc, flag); } @@ -2938,7 +2906,6 @@ int _gdi_draw_one_glyph (PDC pdc, Glyph32 glyph_value, BOOL direction, goto end; } - #ifndef _MGRM_THREADS if (CHECK_DRAWING (pdc)) goto end; #endif @@ -2948,7 +2915,7 @@ int _gdi_draw_one_glyph (PDC pdc, Glyph32 glyph_value, BOOL direction, pdc->step = 1; pdc->cur_ban = NULL; - /*draw back ground */ + /* draw back ground */ if (pdc->bkmode != BM_TRANSPARENT) { pdc->cur_pixel = pdc->bkcolor; draw_back_area (pdc, area, &bg_gal_rc, flag); @@ -2958,13 +2925,8 @@ int _gdi_draw_one_glyph (PDC pdc, Glyph32 glyph_value, BOOL direction, bbx_size.cx = bbox.w; bbx_size.cy = bbox.h; - { - int glyph_ascent = y - bbox.y; - //int glyph_descent = bbox.y + bbox.h - y; - - _gdi_direct_fillglyph (pdc, glyph_value, &fg_gal_rc, &bbx_size, - glyph_ascent, advance, italic, bold); - } + _gdi_direct_fillglyph (pdc, glyph_value, &fg_gal_rc, &bbx_size, + y - bbox.y, advance, italic, bold); draw_glyph_lines (pdc, x, y, x + *adv_x, y + *adv_y); diff --git a/src/newgdi/textout.c b/src/newgdi/textout.c index cd258ef4..5be7f1b0 100644 --- a/src/newgdi/textout.c +++ b/src/newgdi/textout.c @@ -171,7 +171,7 @@ static BOOL cb_textout (void* context, Glyph32 glyph_value, int glyph_type) if (glyph_type == MCHAR_TYPE_ZEROWIDTH) { adv_x = adv_y = 0; } - else if (glyph_type == MCHAR_TYPE_VOWEL){ + else if (glyph_type == MCHAR_TYPE_VOWEL) { if (!ctxt->only_extent) { bkmode = ctxt->pdc->bkmode;