gdi32: Fix text metrics in synthetic bold bitmap fonts.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2018-02-18 21:34:42 +09:00 committed by Alexandre Julliard
parent b4a10d17c6
commit dce3e17185
2 changed files with 7 additions and 5 deletions

View File

@ -7523,6 +7523,9 @@ static BOOL get_bitmap_text_metrics(GdiFont *font)
TM.tmPitchAndFamily = FT_IS_FIXED_WIDTH(ft_face) ? 0 : TMPF_FIXED_PITCH;
TM.tmCharSet = font->charset;
}
if(font->fake_bold)
TM.tmWeight = FW_BOLD;
#undef TM
return TRUE;
@ -7552,10 +7555,12 @@ static void scale_font_metrics(const GdiFont *font, LPTEXTMETRICW ptm)
SCALE_Y(ptm->tmDescent);
SCALE_Y(ptm->tmInternalLeading);
SCALE_Y(ptm->tmExternalLeading);
SCALE_Y(ptm->tmOverhang);
if(FT_IS_SCALABLE(font->ft_face) && font->fake_bold)
SCALE_X(ptm->tmOverhang);
if(font->fake_bold)
{
if(!FT_IS_SCALABLE(font->ft_face))
ptm->tmOverhang++;
ptm->tmAveCharWidth++;
ptm->tmMaxCharWidth++;
}

View File

@ -6583,15 +6583,12 @@ static void test_fake_bold_font(void)
"expected %d, got %d\n", data[i].tm.tmAscent, data[i+1].tm.tmAscent);
ok(data[i].tm.tmDescent == data[i+1].tm.tmDescent,
"expected %d, got %d\n", data[i].tm.tmDescent, data[i+1].tm.tmDescent);
todo_wine
ok(data[i+1].tm.tmAveCharWidth - data[i].tm.tmAveCharWidth == diff,
"expected %d, got %d\n", diff, data[i+1].tm.tmAveCharWidth - data[i].tm.tmAveCharWidth);
todo_wine
ok(data[i+1].tm.tmMaxCharWidth - data[i].tm.tmMaxCharWidth == diff,
"expected %d, got %d\n", diff, data[i+1].tm.tmMaxCharWidth - data[i].tm.tmMaxCharWidth);
ok(data[i].tm.tmOverhang == 0,
"expected 0, got %d\n", data[i].tm.tmOverhang);
todo_wine
ok(data[i+1].tm.tmOverhang == 1,
"expected 1, got %d\n", data[i+1].tm.tmOverhang);
ok(data[i].w + 1 == data[i+1].w,