changeset 3354:00cc1c09c6dd

6951501: EUDC character is not displayed on Swing Reviewed-by: igor, jgodinez
author prr
date Wed, 19 Jan 2011 09:22:40 -0800
parents c8a10bfd2fcb
children e58e9e32399a
files src/windows/classes/sun/awt/Win32FontManager.java src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/classes/sun/awt/Win32FontManager.java	Wed Jan 19 11:31:27 2011 -0500
+++ b/src/windows/classes/sun/awt/Win32FontManager.java	Wed Jan 19 09:22:40 2011 -0800
@@ -81,6 +81,10 @@
      */
     private static native String getEUDCFontFile();
 
+    public TrueTypeFont getEUDCFont() {
+        return eudcFont;
+    }
+
     public Win32FontManager() {
         super();
         AccessController.doPrivileged(new PrivilegedAction() {
@@ -198,7 +202,7 @@
                                      familyToFontListMap,
                                  Locale locale);
 
-    public synchronized native String getFontPath(boolean noType1Fonts);
+    protected synchronized native String getFontPath(boolean noType1Fonts);
 
     public String[] getDefaultPlatformFont() {
 
--- a/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	Wed Jan 19 11:31:27 2011 -0500
+++ b/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	Wed Jan 19 09:22:40 2011 -0800
@@ -214,6 +214,7 @@
 #define EUDCKEY_ZH_CN  L"EUDC\\936"
 #define EUDCKEY_ZH_TW  L"EUDC\\950"
 #define EUDCKEY_KO_KR  L"EUDC\\949"
+#define EUDCKEY_EN_US  L"EUDC\\1252"
 #define LANGID_JA_JP   0x411
 #define LANGID_ZH_CN   0x0804
 #define LANGID_ZH_SG   0x1004
@@ -221,6 +222,7 @@
 #define LANGID_ZH_HK   0x0c04
 #define LANGID_ZH_MO   0x1404
 #define LANGID_KO_KR   0x0412
+#define LANGID_EN_US   0x0409
 
 
 JNIEXPORT jstring JNICALL
@@ -237,6 +239,9 @@
     LANGID langID = GetSystemDefaultLangID();
     //lookup for encoding ID, EUDC only supported in
     //codepage 932, 936, 949, 950 (and unicode)
+    // On Windows 7, at least for me, it shows up in Cp1252 if
+    // I create a custom font. Might as well support that as it makes
+    // verification easier.
     if (langID == LANGID_JA_JP) {
         eudcKey = EUDCKEY_JA_JP;
     } else if (langID == LANGID_ZH_CN || langID == LANGID_ZH_SG) {
@@ -246,6 +251,8 @@
       eudcKey = EUDCKEY_ZH_TW;
     } else if (langID == LANGID_KO_KR) {
         eudcKey = EUDCKEY_KO_KR;
+    } else if (langID == LANGID_EN_US) {
+        eudcKey = EUDCKEY_EN_US;
     } else {
         return NULL;
     }