gdi32: Use OEM codepage for OEM_CHARSET fonts

Dmitry Groshev wjaguar at in-trans.ru
Thu Jul 26 17:17:30 CDT 2007


For bitmap fonts with OEM_CHARSET, Wine assumes the current ANSI code 
page. Which is wrong - these fonts are in OEM codepage, and for Russian 
language at least, ANSI and OEM code pages are two very different things 
(code pages 1251 and 866, respectively), and the fonts render 
incorrectly as a result. This patch fixes this, and gets rid of 
"Untranslated charset" debug message for OEM_CHARSET fonts.


-- 
-= With best regards, Dmitry Groshev =-
-------------- next part --------------
>From 2ce58ceb5402b44338e713e8cbee36f6ca8b9e5e Mon Sep 17 00:00:00 2001
From: Dmitry Groshev <wjaguar at in-trans.ru>
Date: Fri, 27 Jul 2007 02:03:35 +0400
Subject: gdi32: Use OEM codepage for OEM_CHARSET fonts

---
 dlls/gdi32/freetype.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index cdd23ef..03b3aca 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -2320,6 +2320,12 @@ static int get_nearest_charset(Face *fac
 	}
     }
 
+    if (!face->scalable && !face->fs.fsCsb[0]) /* OEM */ {
+	*cp = GetOEMCP();
+	return OEM_CHARSET;
+    }
+
+
     FIXME("returning DEFAULT_CHARSET face->fs.fsCsb[0] = %08x file = %s\n",
 	  face->fs.fsCsb[0], face->file);
     *cp = acp;
@@ -2717,6 +2723,7 @@ GdiFont *WineEngCreateFontInstance(DC *d
     if(!TranslateCharsetInfo((DWORD*)(INT_PTR)lf.lfCharSet, &csi, TCI_SRCCHARSET)) {
         switch(lf.lfCharSet) {
 	case DEFAULT_CHARSET:
+	case OEM_CHARSET:
 	    csi.fs.fsCsb[0] = 0;
 	    break;
 	default:
-- 
1.4.2.1



More information about the wine-patches mailing list