From cab2cacb8e3828c9e451475d68ca550f092072f8 Mon Sep 17 00:00:00 2001 From: Akihiro Sagawa Date: Thu, 17 Oct 2013 21:25:08 +0900 Subject: [PATCH] gdi32: Adjust fake bold outline font metrics. --- dlls/gdi32/freetype.c | 5 ++++- dlls/gdi32/tests/font.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index b39f2ed7e58..45723d3ad38 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -7330,8 +7330,11 @@ static BOOL get_outline_text_metrics(GdiFont *font) } TM.tmMaxCharWidth = SCALE_X(ft_face->bbox.xMax - ft_face->bbox.xMin); TM.tmWeight = FW_REGULAR; - if (font->fake_bold) + if (font->fake_bold) { + TM.tmAveCharWidth++; + TM.tmMaxCharWidth++; TM.tmWeight = FW_BOLD; + } else { if (ft_face->style_flags & FT_STYLE_FLAG_BOLD) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 854d68ba567..17608ce1c82 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -5693,9 +5693,9 @@ static void test_fake_bold_font(void) ok(tm[0].tmHeight == tm[1].tmHeight, "expected %d, got %d\n", tm[0].tmHeight, tm[1].tmHeight); ok(tm[0].tmAscent == tm[1].tmAscent, "expected %d, got %d\n", tm[0].tmAscent, tm[1].tmAscent); ok(tm[0].tmDescent == tm[1].tmDescent, "expected %d, got %d\n", tm[0].tmDescent, tm[1].tmDescent); - todo_wine ok((tm[0].tmAveCharWidth + 1) == tm[1].tmAveCharWidth, + ok((tm[0].tmAveCharWidth + 1) == tm[1].tmAveCharWidth, "expected %d, got %d\n", tm[0].tmAveCharWidth + 1, tm[1].tmAveCharWidth); - todo_wine ok((tm[0].tmMaxCharWidth + 1) == tm[1].tmMaxCharWidth, + ok((tm[0].tmMaxCharWidth + 1) == tm[1].tmMaxCharWidth, "expected %d, got %d\n", tm[0].tmMaxCharWidth + 1, tm[1].tmMaxCharWidth); ok(tm[0].tmOverhang == tm[1].tmOverhang, "expected %d, got %d\n", tm[0].tmOverhang, tm[1].tmOverhang); w[0] = abc[0].abcA + abc[0].abcB + abc[0].abcC;