[2/2] gdi32: Make GetKerningPairsA not fail for fonts with SYMBOL charset

Dmitry Timoshkov dmitry at codeweavers.com
Sun Apr 1 06:17:33 CDT 2007


Hello,

as reported in the bug 6516 GetKerningPairsA fails for a font with SYMBOL
charset due to GetCPInfo failing for CP_SYMBOL code page. The test shows that
it's an expected behaviour for GetCPInfo, so GetKerningPairsA should be fixed
to not fail in that case.

Changelog:
    gdi32: Make GetKerningPairsA not fail for fonts with SYMBOL charset.

---
 dlls/gdi32/font.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index ea2e66c..263454d 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -2662,7 +2662,11 @@ DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs,
         FIXME("Can't find codepage for charset %d\n", charset);
         return 0;
     }
-    if (!GetCPInfo(csi.ciACP, &cpi))
+    /* GetCPInfo() will fail on CP_SYMBOL, and WideCharToMultiByte is supposed
+     * to fail on an invalid character for CP_SYMBOL.
+     */
+    cpi.DefaultChar[0] = 0;
+    if (csi.ciACP != CP_SYMBOL && !GetCPInfo(csi.ciACP, &cpi))
     {
         FIXME("Can't find codepage %u info\n", csi.ciACP);
         return 0;
-- 
1.5.0.5






More information about the wine-patches mailing list