[2/2] gdi32: Add a test for GetFontUnicodeRanges with SYMBOL_CHARSET fonts

Dmitry Timoshkov dmitry at codeweavers.com
Wed Mar 14 08:17:34 CDT 2007


Hello,

Changelog:
    gdi32: Add a test for GetFontUnicodeRanges with SYMBOL_CHARSET fonts.

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

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 18a2986..7754c8f 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1482,6 +1482,32 @@ static void test_text_metrics(const LOGFONTA *lf)
 
     hfont_old = SelectObject(hdc, hfont);
 
+    if (pGetFontUnicodeRanges && lf->lfCharSet == SYMBOL_CHARSET)
+    {
+        GLYPHSET *gs;
+
+        SetLastError(0xdeadbeef);
+        size = pGetFontUnicodeRanges(hdc, NULL);
+        ok(size, "GetFontUnicodeRanges error %u\n", GetLastError());
+
+        gs = HeapAlloc(GetProcessHeap(), 0, size);
+
+        size = pGetFontUnicodeRanges(hdc, gs);
+        ok(size, "GetFontUnicodeRanges failed\n");
+todo_wine {
+        ok(gs->cRanges != 0, "GetFontUnicodeRanges returned empty ranges\n");
+}
+        /* It appears that for fonts with SYMBOL_CHARSET Windows always sets
+         * first and last character code in ranges to 0 and f0ff.
+         */
+        first_unicode_char = gs->ranges[0].wcLow;
+        last_unicode_char = gs->ranges[gs->cRanges - 1].wcLow + gs->ranges[gs->cRanges - 1].cGlyphs - 1;
+todo_wine {
+        ok(first_unicode_char == 0, "first char in range is %x, not 0\n", first_unicode_char);
+        ok(last_unicode_char == 0xf0ff, "last char in range is %x, not f0ff\n", last_unicode_char);
+}
+    }
+
     size = GetFontData(hdc, MS_OS2_TAG, 0, NULL, 0);
     if (size == GDI_ERROR)
     {
-- 
1.5.0.2






More information about the wine-patches mailing list