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.

Bug 86518 - I18N - Japanese and asian characters are not displayed properly in dialogs
Summary: I18N - Japanese and asian characters are not displayed properly in dialogs
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: David Simonek
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2006-10-04 21:24 UTC by cmorley
Modified: 2008-12-22 14:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Standard java file chooser (36.82 KB, image/png)
2006-10-04 21:25 UTC, cmorley
Details
NB 5.5 beta file chooser (note filename text) (37.06 KB, image/png)
2006-10-04 21:26 UTC, cmorley
Details
diff of tahoma hack removal (7.19 KB, patch)
2006-10-23 15:22 UTC, David Simonek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cmorley 2006-10-04 21:24:11 UTC
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.
Comment 1 cmorley 2006-10-04 21:25:16 UTC
Created attachment 34881 [details]
Standard java file chooser
Comment 2 cmorley 2006-10-04 21:26:00 UTC
Created attachment 34882 [details]
NB 5.5 beta file chooser (note filename text)
Comment 3 cmorley 2006-10-09 15:39:35 UTC
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);
Comment 4 Ken Frank 2006-10-09 15:59:14 UTC
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
Comment 5 cmorley 2006-10-09 20:53:31 UTC
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
Comment 6 David Simonek 2006-10-23 15:20:35 UTC
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.

Comment 7 David Simonek 2006-10-23 15:22:58 UTC
Created attachment 35472 [details]
diff of tahoma hack removal
Comment 8 David Simonek 2006-10-23 15:32:23 UTC
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
Comment 9 Ken Frank 2007-05-26 17:25:20 UTC
Dafe,  I want to verify it - what is the scenario to use and which locales
should be used ?

ken.frank@sun.com
Comment 10 David Simonek 2007-05-28 08:43:51 UTC
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.
Comment 11 Ken Frank 2007-05-30 04:16:45 UTC
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
Comment 12 Ken Frank 2007-06-08 18:41:14 UTC
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
Comment 13 cmorley 2007-06-25 20:10:40 UTC
M9 looks OK to me (running en_us locale, using cjk characters/filenames).
Thanks,
Chris
Comment 14 Ken Frank 2007-06-25 21:07:03 UTC
verifying based on cmorley's comments - thanks for this information.

ken.frank@sun.com