Akihiro Sagawa : gdi32: Fix the B spacing value of empty glyph.

Alexandre Julliard julliard at winehq.org
Wed Oct 2 15:49:13 CDT 2013


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

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Wed Oct  2 20:42:35 2013 +0900

gdi32: Fix the B spacing value of empty glyph.

---

 dlls/gdi32/freetype.c   |    2 +-
 dlls/gdi32/tests/font.c |   17 ++++++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 15f401a..ca9e18f 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -6525,7 +6525,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
     lpgm->gmptGlyphOrigin.x = origin_x >> 6;
     lpgm->gmptGlyphOrigin.y = origin_y >> 6;
     abc->abcA = left >> 6;
-    abc->abcB = width;
+    abc->abcB = lpgm->gmBlackBoxX;
     abc->abcC = adv - abc->abcA - abc->abcB;
 
     TRACE("%u,%u,%s,%d,%d\n", lpgm->gmBlackBoxX, lpgm->gmBlackBoxY,
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index f6e4d07..031b86a 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1298,11 +1298,22 @@ static void test_GetCharABCWidths(void)
         DeleteObject(hfont);
     }
 
-    ReleaseDC(NULL, hdc);
-
     memset(&lf, 0, sizeof(lf));
     strcpy(lf.lfFaceName, "Tahoma");
     lf.lfHeight = 20;
+    hfont = CreateFontIndirectA(&lf);
+
+    /* test empty glyph's metrics */
+    hfont = SelectObject(hdc, hfont);
+    ret = pGetCharABCWidthsFloatW(hdc, ' ', ' ', abcf);
+    ok(ret, "GetCharABCWidthsFloatW should have succeeded\n");
+    ok(abcf[0].abcfB == 1.0, "got %f\n", abcf[0].abcfB);
+    ret = pGetCharABCWidthsW(hdc, ' ', ' ', abcw);
+    ok(ret, "GetCharABCWidthsW should have succeeded\n");
+    ok(abcw[0].abcB == 1, "got %u\n", abcw[0].abcB);
+
+    DeleteObject(SelectObject(hdc, hfont));
+    ReleaseDC(NULL, hdc);
 
     trace("ABC sign test for a variety of transforms:\n");
     hfont = CreateFontIndirectA(&lf);
@@ -1318,7 +1329,7 @@ static void test_GetCharABCWidths(void)
     ret = pGetCharABCWidthsI(hdc, 0, 1, glyphs, abc);
     ok(ret, "GetCharABCWidthsI should have succeeded\n");
     ret = pGetCharABCWidthsW(hdc, 'i', 'i', abcw);
-    ok(ret, "GetCharABCWidthsI should have succeeded\n");
+    ok(ret, "GetCharABCWidthsW should have succeeded\n");
     ret = pGetCharABCWidthsFloatW(hdc, 'i', 'i', abcf);
     ok(ret, "GetCharABCWidthsFloatW should have succeeded\n");
 




More information about the wine-cvs mailing list