This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Japanese and asian characters are not displayed properly in dialogs (eg, file chooser, but also text edit boxes and other components), apparently because netbeans is overriding the default java fonts. This is seen in all nb versions I have tried, up to and including 5.5 beta. See attached screen shots of the nb 5.5 beta "Open File" file chooser vs the standard java JFileChooser. This is a windows xp machine with j/ea fonts installed, but still us/english default locale.
Created attachment 34881 [details] Standard java file chooser
Created attachment 34882 [details] NB 5.5 beta file chooser (note filename text)
Work around for module/platform developers is to do something like this in ModuleInstall.installed/restored method: java.awt.Font defaultFont = new java.awt.Font("SansSerif", java.awt.Font.PLAIN, 11); UIDefaults uiDefaults = UIManager.getDefaults(); // java.util.Enumeration keys = uiDefaults.keys(); // while (keys.hasMoreElements()) { // String key = keys.nextElement().toString(); // if (key.endsWith("Font")) // System.out.println(key+": "+uiDefaults.get(key)); // } // Override font for components of interest uiDefaults.put("ComboBox.font", defaultFont); uiDefaults.put("Label.font", defaultFont); uiDefaults.put("TextArea.font", defaultFont); uiDefaults.put("TextField.font", defaultFont); uiDefaults.put("Tree.font", defaultFont);
Yes, have seen this in nb iteself using en xp with locales set to asian locales and other fonts installed - thought for a long time it was a jdk font mapping situation, since did not happen on real localized windows of ja or zh. Also, seemed to happen at default font size 11 vs larger fonts; also, seemed to happen mostly when the ui object was in bold font, but displayed ok other times when it was not bold. Can you see if it happens to you when font is larger or not in bold ? (start netbeans with --fontsize 14 argument. ken.frank@sun.com
Ken - Yes, I still see the "empty box" characters in the File name: text entry in the Open File dialog in nb 5.5B even if I start with --fontsize 14. I assume somewhere in the nb code (grep for UIDefaults) someone is overriding the default java fonts for something that looks "nicer" for the latin chars. Chris
Yes, cmorley is exactly right, there is code to override fonts to Tahoma in NetBeans, namely in org.netbeans.swing.plaf.winxp.XPLFCustoms.java source. In fact this was only workaround for JDK bug 5079742. However, activation of the workaround caused the problems you did experience. I decided to remove workaround from NetBeans code completely, as original JDK bug 5079742 was fixed in 1.5.0u2 and higher.
Created attachment 35472 [details] diff of tahoma hack removal
As you can see from the diff, "tahoma hack" was active only on XP when non-japanese-like locales was currently selected. However as your investigaion shows, that was not sufficient. fixed in main trunk: Checking in winvista/VistaLFCustoms.java; /cvs/core/swing/plaf/src/org/netbeans/swing/plaf/winvista/VistaLFCustoms.java,v <-- VistaLFCustoms.java new revision: 1.3; previous revision: 1.2 done Checking in winxp/XPLFCustoms.java; /cvs/core/swing/plaf/src/org/netbeans/swing/plaf/winxp/XPLFCustoms.java,v <-- XPLFCustoms.java new revision: 1.18; previous revision: 1.17
Dafe, I want to verify it - what is the scenario to use and which locales should be used ? ken.frank@sun.com
Ken, I think it's enough to run NB with -ja or -zh locale and have Japanese/Chinese fonts installed and then check opening files, as cmorley wrote in initial bug reproduction.
Dafe, I don't know if this is related or expected - see issue 103908 where they are seeing the "square boxes" when running in ja or zh locale but giving --locale en argument. Could that be a problem as to the fix to this one ? or could it be that some things are being kept in user dir vs in product, and so those are still showing as mbyte ? see the attached png in that bug for the word Welcome on the welcome tab but also the open project window or are those words on left of open project window from the os itself, but since nb is viewing itself in en locale, that it would not show the localized characters ok ? Also, in that bug, Marian refers to these bugs bug #50993 - "Cannot display Chinese text in FileChooser" bug #52178 - "Most of Japanese glyphs on IDE seem broken on windowsXP platform." bug #52233 - "I18N - need fix same as that of 52178 so that multibyte can be displayed properly" which might be related to the square boxes situations also. ken.frank@sun.com
cmorely Can you try it using netbeans 6 from netbeans.org ? Also, are you running in english locale but using asian characters, or running under asian locale ? (or starting ide in asian locale but using --locale en argument ?) We've seen some slight differences in behavior in each case and want to make sure its ok for each. ken.frank@sun.com
M9 looks OK to me (running en_us locale, using cjk characters/filenames). Thanks, Chris
verifying based on cmorley's comments - thanks for this information. ken.frank@sun.com