Akihiro Sagawa : gdi32/tests: Add more GetCharABCWidths tests for rotated font.

Alexandre Julliard julliard at winehq.org
Mon Jan 13 12:46:33 CST 2014


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

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Fri Jan 10 20:29:56 2014 +0900

gdi32/tests: Add more GetCharABCWidths tests for rotated font.

---

 dlls/gdi32/tests/font.c |   27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 54e32ad..28bec52 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1300,7 +1300,7 @@ static void test_GetCharABCWidths(void)
 
     memset(&lf, 0, sizeof(lf));
     strcpy(lf.lfFaceName, "Tahoma");
-    lf.lfHeight = 20;
+    lf.lfHeight = 200;
     hfont = CreateFontIndirectA(&lf);
 
     /* test empty glyph's metrics */
@@ -1312,10 +1312,35 @@ static void test_GetCharABCWidths(void)
     ok(ret, "GetCharABCWidthsW should have succeeded\n");
     ok(abcw[0].abcB == 1, "got %u\n", abcw[0].abcB);
 
+    /* 1) prepare unrotated font metrics */
+    ret = pGetCharABCWidthsW(hdc, 'a', 'a', abcw);
+    ok(ret, "GetCharABCWidthsW should have succeeded\n");
+    DeleteObject(SelectObject(hdc, hfont));
+
+    /* 2) get rotated font metrics */
+    lf.lfEscapement = lf.lfOrientation = 900;
+    hfont = CreateFontIndirectA(&lf);
+    hfont = SelectObject(hdc, hfont);
+    ret = pGetCharABCWidthsW(hdc, 'a', 'a', abc);
+    ok(ret, "GetCharABCWidthsW should have succeeded\n");
+
+    /* 3) compare ABC results */
+    todo_wine {
+    ok(match_off_by_1(abcw[0].abcA, abc[0].abcA, FALSE),
+       "got %d, expected %d (A)\n", abc[0].abcA, abcw[0].abcA);
+    ok(match_off_by_1(abcw[0].abcB, abc[0].abcB, FALSE),
+       "got %d, expected %d (B)\n", abc[0].abcB, abcw[0].abcB);
+    ok(match_off_by_1(abcw[0].abcC, abc[0].abcC, FALSE),
+       "got %d, expected %d (C)\n", abc[0].abcC, abcw[0].abcC);
+    }
+
     DeleteObject(SelectObject(hdc, hfont));
     ReleaseDC(NULL, hdc);
 
     trace("ABC sign test for a variety of transforms:\n");
+    memset(&lf, 0, sizeof(lf));
+    strcpy(lf.lfFaceName, "Tahoma");
+    lf.lfHeight = 20;
     hfont = CreateFontIndirectA(&lf);
     hwnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,
                            0, 0, 0, NULL);




More information about the wine-cvs mailing list