-
Bug
-
Resolution: Cannot Reproduce
-
P2
-
None
-
1.4.1
-
generic
-
generic
Name: jbT81659 Date: 04/16/2002
Locale: iw_IL
Regression: Yes
Build: JDK1.4.1-b07
Tested Platforms: Win-ME, Win2000, Win XP (all hebrew native)
In Merlin Metal LAF selects Arial font to display arabic and hebrew characters in java
applications that have no font set explicitly in them. Arial has support for both arabic
and hebrew characters. This is essential to display bidi sentences that have both arabic
and hebrew in them (in addition to english).
In Hopper however, Metal LAF selects "David" font if the font is not set explicitly in the
java application. This font displays hebrew and english characters correctly but does not
have support for arabic. This in turn causes arabic glyphs to be displayed as boxes.
Selecting the "David" font by default is not practical since many java applications in
israel and the middle east area need to display both arabic and hebrew in the same sentence.
To reproduce bug:
1- Start testing under Merlin jdk1.4.0-b92
2- Choose a hebrew native Windows platform (XP iw_IL for example)
3- Compile the following source code (jButton.java)
4- Execute the test case
5- Note that arabic, hebrew and english characters are displayed correctly
6- Note at the command prompt that font used is "dialog"
7- Change tested jdk to jdk1.4.1-b07 (Hopper)
8- Execute the test case "jButton.java"
9- Note that hebrew and english characters are displayed correctly
10- Note that arabic characters are displayed as boxes
11- Note at the command prompt that font used is "David"
------------Code------------------
/* Copyright (c) Sun Microsystems 1998
$Header: $
*/
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.applet.*;
import javax.swing.*;
import java.util.*;
public class jButton extends JApplet
{
public void init()
{
jButton chckbox1 = new jButton();
getContentPane().add(chckbox1);
}
public static void main(String[] argv)
{
JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
frame.setContentPane(new jButton1());
frame.setSize(300, 500);
frame.setVisible(true);
frame.addWindowListener( new WindowAdapter()
{
public void windowClosing( WindowEvent e)
{
System.exit(0);
}
});
}
}
class jButton1 extends JPanel
{
public jButton1()
{
JButton Button1, Button2, Button3;
Font f1, f2, f3;
Button1 = new JButton("\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u0643\u0628\u064a\u0631\u0020\u0042\u0049\u0047\u0020\u0052\u0045\u0044\u0020\u0041\u0050\u0050\u004c\u0045\u0053");
Button2 = new JButton("\u05d6\u05d5\u0020\u05e9\u05e0\u05d4\u0020\u05d9\u05e4\u05d4\u0020\u0054\u0048\u0045\u0020\u0059\u0045\u0041\u0052\u0020\u0031\u0039\u0035\u0038");
Button3 = new JButton("\u0647\u0630\u0627\u0020\u064a\u0648\u0645\u0020\u0644\u0637\u064a\u0641\u0020\u05d6\u05d4\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd");
f1 = Button1.getFont();
f2 = Button2.getFont();
f3 = Button3.getFont();
System.out.println("Button1 Font is "+ Button1.getFont()+ " "+ f1.getFontName());
System.out.println("Button2 Font is "+ Button2.getFont()+ " "+ f2.getFontName());
System.out.println("Button3 Font is "+ Button3.getFont()+ " "+ f3.getFontName());
/*
Button1.setFont(new Font("Lucida Sans Regular", Font.PLAIN, 12));
Button2.setFont(new Font("Lucida Sans Regular", Font.PLAIN, 12));
Button3.setFont(new Font("Lucida Sans Regular", Font.PLAIN, 12));
*/
add(Button1);
add(Button2);
add(Button3);
}
}
======================================================================