JDK-4720513 : cannot display 8bit umlauts in font "Lucida Sans Typewriter" and "Lucida Sans"
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.3.1_04
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_7
  • CPU: generic
  • Submitted: 2002-07-25
  • Updated: 2002-07-26
  • Resolved: 2002-07-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 1.4Fixed
Related Reports
Relates :  
Description
Java 1.3.1 is unable to display 8bit umlauts in font "Lucida Sans Typewriter" 
and "Lucida Sans", if package SUNWi1of is installed.

The problem can be easily reproduced:

1. Testcase
-----------

% more test.java
import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class test extends Frame {
  Font f1, f2, f3, f4, f5, f6;

  public test() {
    f1 = new Font("Times New Roman", Font.PLAIN, 10);
    f2 = new Font("SansSerif", Font.PLAIN, 10);
    f3 = new Font("Lucida Console", Font.PLAIN, 10);
    f4 = new Font("Lucida Sans Typewriter", Font.PLAIN, 10);
    f5 = new Font("Lucida", Font.PLAIN, 10);
    f6 = new Font("Lucida Sans", Font.PLAIN, 10);
    setVisible(true);
  }

  public void paint(Graphics g) {
    g.setFont(f1);
    drawString(g, "Times New Roman", 60);
    g.setFont(f2);
    drawString(g, "SansSerif", 80);
    g.setFont(f3);
    drawString(g, "Lucida Console", 100);
    g.setFont(f4);
    drawString(g, "Lucida Sans Typewriter", 120);
    g.setFont(f5);
    drawString(g, "Lucida", 140);
    g.setFont(f6);
    drawString(g, "Lucida Sans", 160);
  }

  public void drawString(Graphics g, String s, int y) {
    String t = "\344\366\374  \u00C4\u00D6\u00DC\u00C5\u00e4\u00f6\u00fc\u00df";
    g.drawString(s + ": " + t, 10, y);
  }

  public static void main(String argv[]) {
    test t = new test();
    Graphics g = t.getGraphics();
    t.setSize(200, 100);
    t.paint(g);

    t.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        System.exit(0);
      }
    });
  }
}
%


2. Compile and run
------------------

The problem is only reproducible, if SUNWi1of is present.

% pkginfo SUNWi1of
system      SUNWi1of       ISO-8859-1 (Latin-1) Optional Fonts
% 

% /j2sdk1_3_1_04/bin/java -version
java version "1.3.1_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_04-b02)
Java HotSpot(TM) Client VM (build 1.3.1_04-b02, mixed mode)
/j2sdk1_3_1_04/bin/javac test.java
% 

% /j2sdk1_3_1_04/bin/java test

a window will pop up, listing six lines:
(The umlaut charcters are paraphrased in the following.)

"Times New Roman: <some 8bit characters "o"a"u "A"O"U��A"a"o"u"s>"
"SansSerif: <some 8bit characters "o"a"u "A"O"U��A"a"o"u"s>"
"Lucida Console: <some 8bit characters "o"a"u "A"O"U��A"a"o"u"s>"
"Lucida Sans Typewriter: <some strange characters>"
"Lucida: <some 8bit characters "o"a"u "A"O"U��A"a"o"u"s>"
"Lucida Sans:  <some strange characters>"

Select WindowManager->close to exit.

The behaviour is independent of the locale at compiletime or at runtime.



Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.4 INTEGRATED IN: 1.4
14-06-2004

WORK AROUND The problem disappears, as soon as package SUNWi1of is removed. This is strange because SUNWi1of is required for all locales according to Java 1.3.1 Font Package Requirements http://java.sun.com/j2se/1.3/font-requirements.html ###@###.### 2002-08-07 ------------------------------ workaround as proposed by engineering: Compile and run the test case as follows and see the fonts displayed. javac test.java java -Dsun.java2d.noType1Font=true test
11-06-2004

PUBLIC COMMENTS Java 1.3.1 is unable to display 8bit umlauts in font "Lucida Sans Typewriter" and "Lucida Sans", if package SUNWi1of is installed.
10-06-2004

EVALUATION I believe that this is in substantial part due to Type1 X11 platform fonts being picked up instead of the intended JRE fonts. Printing out the names of the fonts in 1.3.1 shows :- java.awt.Font[family=LucidaSansTypewriter,name=Lucida Sans Typewriter,style=plain,size=14] java.awt.Font[family=LucidaSans,name=Lucida Sans,style=plain,size=10] Code was added in 1.4 to pick up the right JRE fonts. Consquently I am marking this bug integrated in 1.4 ###@###.### 2002-07-25 ============================
25-07-2002