-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.1.4
-
x86
-
solaris_2.6
Customer reported he was unable to use Japanese fonts under win32.
I was able to reproduce this under win32. Things worked fine under
Solaris.
To reproduce.
1) Install the fonts off of the NT installation CD.
Theses fonts are located in the langpack directory.
2) Copy the fonts.property.ja file to fonts.property.
3) Run the supplied testcase.
Notice that the Japanese font fails to display in the pull down menu.
I did some digging and found the problem in the fonts.properties.ja
file included with the Win32 distribution of the JDK1.1.4. I made some
modifications and then things worked fine.
---before----
# @(#)font.properties.ja 1.6 97/03/03
#
# AWT Font default Properties for Japanese Windows
#
dialog.0=Arial,ANSI_CHARSET
dialog.1=\uff2d\uff33 \u30b4\u30b7\u30c3\u30af,SHIFTJIS_CHARSET
dialog.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
..
..
----after----
# @(#)font.properties.ja 1.6 97/03/03
#
# AWT Font default Properties for Japanese Windows
#
dialog.0=Arial,ANSI_CHARSET
dialog.1=Gulim,SHIFTJIS_CHARSET
dialog.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
..
..
The reference of the font uff2d\uff33 \u30b4\u30b7\u30c3\u30af via
Uni-code characters seems to be the culprit. I replaced all instances
of this font reference with Guilm (supplied from the NT CD).
Simple enough to fix.
Testcase:
import java.awt.*;
import java.awt.event.*;
/*
* This is a simple example which displays Japanese uni-code characters
* in a menu item. Note, font.properties.ja must be copied to
* font.properties to have the JVM load the proper fonts. Also, ensure
* that the system has these fonts to load.
*/
public class Test extends Frame implements ActionListener {
public Test() {
super( "Font Example" );
Menu myMenu = new Menu( "Select" );
myMenu.add( "Standard ASCII" );
myMenu.add( "\u3041\u3042\u3043\u3044" );
myMenu.add( "\u3045\u3046\u3047\u3048\u3049\u304a\u304b" );
MenuItem exitItem = new MenuItem( "Exit" );
exitItem.addActionListener( this );
myMenu.add( exitItem );
MenuBar myMenuBar = new MenuBar();
myMenuBar.add( myMenu );
add( new Label( "The select menu shows an example of Uni-code Japanese" ) );
setMenuBar( myMenuBar );
addWindowListener( new MyAdapter() );
pack();
}
public void actionPerformed( ActionEvent evt ) {
System.exit( 0 );
}
static class MyAdapter extends WindowAdapter {
public void windowClosing( WindowEvent evt ) {
System.exit( 0 );
}
}
public static void main( String args[] ) {
Test program = new Test();
program.setVisible( true );
}
}
I was able to reproduce this under win32. Things worked fine under
Solaris.
To reproduce.
1) Install the fonts off of the NT installation CD.
Theses fonts are located in the langpack directory.
2) Copy the fonts.property.ja file to fonts.property.
3) Run the supplied testcase.
Notice that the Japanese font fails to display in the pull down menu.
I did some digging and found the problem in the fonts.properties.ja
file included with the Win32 distribution of the JDK1.1.4. I made some
modifications and then things worked fine.
---before----
# @(#)font.properties.ja 1.6 97/03/03
#
# AWT Font default Properties for Japanese Windows
#
dialog.0=Arial,ANSI_CHARSET
dialog.1=\uff2d\uff33 \u30b4\u30b7\u30c3\u30af,SHIFTJIS_CHARSET
dialog.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
..
..
----after----
# @(#)font.properties.ja 1.6 97/03/03
#
# AWT Font default Properties for Japanese Windows
#
dialog.0=Arial,ANSI_CHARSET
dialog.1=Gulim,SHIFTJIS_CHARSET
dialog.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
..
..
The reference of the font uff2d\uff33 \u30b4\u30b7\u30c3\u30af via
Uni-code characters seems to be the culprit. I replaced all instances
of this font reference with Guilm (supplied from the NT CD).
Simple enough to fix.
Testcase:
import java.awt.*;
import java.awt.event.*;
/*
* This is a simple example which displays Japanese uni-code characters
* in a menu item. Note, font.properties.ja must be copied to
* font.properties to have the JVM load the proper fonts. Also, ensure
* that the system has these fonts to load.
*/
public class Test extends Frame implements ActionListener {
public Test() {
super( "Font Example" );
Menu myMenu = new Menu( "Select" );
myMenu.add( "Standard ASCII" );
myMenu.add( "\u3041\u3042\u3043\u3044" );
myMenu.add( "\u3045\u3046\u3047\u3048\u3049\u304a\u304b" );
MenuItem exitItem = new MenuItem( "Exit" );
exitItem.addActionListener( this );
myMenu.add( exitItem );
MenuBar myMenuBar = new MenuBar();
myMenuBar.add( myMenu );
add( new Label( "The select menu shows an example of Uni-code Japanese" ) );
setMenuBar( myMenuBar );
addWindowListener( new MyAdapter() );
pack();
}
public void actionPerformed( ActionEvent evt ) {
System.exit( 0 );
}
static class MyAdapter extends WindowAdapter {
public void windowClosing( WindowEvent evt ) {
System.exit( 0 );
}
}
public static void main( String args[] ) {
Test program = new Test();
program.setVisible( true );
}
}