Aric Stewart : gdi32/tests: Add a test case for vertical fonts enumeration order.

Alexandre Julliard julliard at winehq.org
Thu Jun 20 15:31:16 CDT 2013


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue Jun 18 07:42:00 2013 -0500

gdi32/tests: Add a test case for vertical fonts enumeration order.

---

 dlls/gdi32/tests/font.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 9563da9..6ee8db4 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -5098,6 +5098,42 @@ static void test_max_height(void)
     return;
 }
 
+static void test_vertical_order(void)
+{
+    struct enum_font_data efd;
+    LOGFONTA lf;
+    HDC hdc;
+    int i, j;
+
+    hdc = CreateCompatibleDC(0);
+    ok(hdc != NULL, "CreateCompatibleDC failed\n");
+
+    memset(&lf, 0, sizeof(lf));
+    lf.lfCharSet = DEFAULT_CHARSET;
+    lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+    lf.lfHeight = 16;
+    lf.lfWidth = 16;
+    lf.lfQuality = DEFAULT_QUALITY;
+    lf.lfItalic = FALSE;
+    lf.lfWeight = FW_DONTCARE;
+    efd.total = 0;
+    EnumFontFamiliesExA(hdc, &lf, enum_font_data_proc, (LPARAM)&efd, 0);
+    for (i = 0; i < efd.total; i++)
+    {
+        if (efd.lf[i].lfFaceName[0] != '@') continue;
+        for (j = 0; j < efd.total; j++)
+        {
+            if (!strcmp(efd.lf[i].lfFaceName + 1, efd.lf[j].lfFaceName))
+            {
+                ok(i > j,"Found vertical font %s before its horizontal version\n", efd.lf[i].lfFaceName);
+                break;
+            }
+        }
+    }
+    DeleteDC( hdc );
+}
+
+
 START_TEST(font)
 {
     init();
@@ -5155,6 +5191,7 @@ START_TEST(font)
     test_fullname2();
     test_east_asian_font_selection();
     test_max_height();
+    test_vertical_order();
 
     /* These tests should be last test until RemoveFontResource
      * is properly implemented.




More information about the wine-cvs mailing list