Akihiro Sagawa : gdi32: Adjust fake bold outline font metrics.

Alexandre Julliard julliard at winehq.org
Mon Oct 21 14:58:26 CDT 2013


Module: wine
Branch: master
Commit: cab2cacb8e3828c9e451475d68ca550f092072f8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cab2cacb8e3828c9e451475d68ca550f092072f8

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Thu Oct 17 21:25:08 2013 +0900

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 b39f2ed..45723d3 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 854d68b..17608ce 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;




More information about the wine-cvs mailing list