Index: trunk/src/gdi32/font.cpp
===================================================================
--- trunk/src/gdi32/font.cpp	(revision 10369)
+++ trunk/src/gdi32/font.cpp	(revision 10372)
@@ -1,3 +1,3 @@
-/* $Id: font.cpp,v 1.33 2003-12-01 13:28:10 sandervl Exp $ */
+/* $Id: font.cpp,v 1.34 2004-01-08 11:11:55 sandervl Exp $ */
 
 /*
@@ -167,4 +167,7 @@
     int charset = GetTextCharset(hdc);
 
+    if( IsDBCSEnv() && ( charset == 0 ))
+        cp = CP_ACP;
+    else
     /* Hmm, nicely designed api this one! */
     if(TranslateCharsetInfo((DWORD*)charset, &csi, TCI_SRCCHARSET))
@@ -172,31 +175,31 @@
     else {
         switch(charset) {
-	case OEM_CHARSET:
-	    cp = GetOEMCP();
-	    break;
-	case DEFAULT_CHARSET:
-	    cp = GetACP();
-	    break;
-
-	case VISCII_CHARSET:
-	case TCVN_CHARSET:
-	case KOI8_CHARSET:
-	case ISO3_CHARSET:
-	case ISO4_CHARSET:
-	  /* FIXME: These have no place here, but because x11drv
-	     enumerates fonts with these (made up) charsets some apps
-	     might use them and then the FIXME below would become
-	     annoying.  Now we could pick the intended codepage for
-	     each of these, but since it's broken anyway we'll just
-	     use CP_ACP and hope it'll go away...
-	  */
-	    cp = CP_ACP;
-	    break;
-
-
-	default:
-	    dprintf(("Can't find codepage for charset %d\n", charset));
-	    break;
-	}
+    case OEM_CHARSET:
+        cp = GetOEMCP();
+        break;
+    case DEFAULT_CHARSET:
+        cp = GetACP();
+        break;
+
+    case VISCII_CHARSET:
+    case TCVN_CHARSET:
+    case KOI8_CHARSET:
+    case ISO3_CHARSET:
+    case ISO4_CHARSET:
+      /* FIXME: These have no place here, but because x11drv
+         enumerates fonts with these (made up) charsets some apps
+         might use them and then the FIXME below would become
+         annoying.  Now we could pick the intended codepage for
+         each of these, but since it's broken anyway we'll just
+         use CP_ACP and hope it'll go away...
+      */
+        cp = CP_ACP;
+        break;
+
+
+    default:
+        dprintf(("Can't find codepage for charset %d\n", charset));
+        break;
+    }
     }
 
@@ -206,10 +209,10 @@
     if(cp != CP_SYMBOL) {
         lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0);
-	strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));
-	MultiByteToWideChar(cp, 0, str, count, strW, lenW);
+    strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));
+    MultiByteToWideChar(cp, 0, str, count, strW, lenW);
     } else {
         lenW = count;
-	strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));
-	for(i = 0; i < count; i++) strW[i] = (BYTE)str[i];
+    strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));
+    for(i = 0; i < count; i++) strW[i] = (BYTE)str[i];
     }
     strW[lenW] = '\0';
Index: trunk/src/gdi32/oslibgpi.cpp
===================================================================
--- trunk/src/gdi32/oslibgpi.cpp	(revision 10369)
+++ trunk/src/gdi32/oslibgpi.cpp	(revision 10372)
@@ -1,3 +1,3 @@
-/* $Id: oslibgpi.cpp,v 1.15 2003-12-01 13:27:39 sandervl Exp $ */
+/* $Id: oslibgpi.cpp,v 1.16 2004-01-08 11:11:55 sandervl Exp $ */
 
 /*
@@ -265,5 +265,5 @@
   if (box[TXTBOX_BOTTOMLEFT].y == box[TXTBOX_BOTTOMRIGHT].y)
   {
-    point->y = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y) + 1;
+    point->y = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y);
     point->x = labs (box[TXTBOX_CONCAT].x - box[TXTBOX_BOTTOMLEFT].x);
 
@@ -278,10 +278,10 @@
   } else
   {
-    cx = labs (box[TXTBOX_BOTTOMLEFT].x-box[TXTBOX_TOPLEFT].x) + 1;
-    cy = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y) + 1;
+    cx = labs (box[TXTBOX_BOTTOMLEFT].x-box[TXTBOX_TOPLEFT].x);
+    cy = labs (box[TXTBOX_BOTTOMLEFT].y-box[TXTBOX_TOPLEFT].y);
     point->y = (ULONG)hypot(cx,cy);
 
-    cx = labs (box[TXTBOX_TOPRIGHT].x-box[TXTBOX_TOPLEFT].x) + 1;
-    cy = labs (box[TXTBOX_TOPRIGHT].y-box[TXTBOX_TOPLEFT].y) + 1;
+    cx = labs (box[TXTBOX_TOPRIGHT].x-box[TXTBOX_TOPLEFT].x);
+    cy = labs (box[TXTBOX_TOPRIGHT].y-box[TXTBOX_TOPLEFT].y);
     point->x  = (ULONG)hypot(cx,cy);
   }
