JDK-4133485 : Can't draw non-ASCII characters
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.1.4,1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS:
    generic,solaris_2.5.1,windows_95,windows_nt generic,solaris_2.5.1,windows_95,windows_nt
  • CPU: generic,x86,sparc
  • Submitted: 1998-04-29
  • Updated: 1998-05-15
  • Resolved: 1998-05-15
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Description
Run the application FontTest (see below) on a JDK with the changes put back by the 2D team on 1998.04.28, and in the Japanese locale. The application should draw a string containing the German sharp-s character, small and full-size Japanese hiragana-a characters, and "abc", each one several times. Only the "abc" is drawn as itself, all the non-ASCII characters are rendered as random ASCII characters.

The application works fine on the JDK-1.2beta4-C build.

---------------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import java.text.*;

public class FontTest extends Frame {

    public FontTest() {
        setTitle("Font Test");
        setSize(400, 400);
        add(new FontTestCanvas(), "North");
        show();
        getComponent(0).requestFocus();
    }

    public static void main(String argv[]) {
        FontTest test = new FontTest();
    }
}

class FontTestCanvas extends Canvas {

    FontTestCanvas() {
        super();
	setSize(300, 80);
	setBackground(Color.cyan);
	setVisible(true);
	setEnabled(true);
    }
    
     public void paint(Graphics g) {
        super.paint(g);
	g.setColor(getForeground());
	g.drawString("\u00df\u3041\u3042\u00df\u3041\u3042\u00df\u3041abc\u3042\u00dfabc", 5, 15);
    }
    
}

Comments
PUBLIC COMMENTS new property "java2d.font.usePlatformFont=true" enables workaround.
10-06-2004

WORK AROUND change assignment of "textpipe= <cast> this" in the "if (xxx instanceof deviceclipping)" to read "textpipe = <cast> g2d" in method RasterOutputManager.validatePipe paul.charlton@eng 1998-04-30 On Solaris 2.6 and Windows NT the behaviour of posted regression test is correct. Codes 0x00DF, 0x0061, 0x0062, 0x0063 are shown correctly and in correct order. dmitry.feld@eng 1998-04-30 Little addition: Solaris 2.6, not NT. NT has a problem. Paul and I worked around and Paul came to conclusion, the fix suggested above is better solution for now. The fix was delivered and tested. dmitry.feld@eng 1998-05-01 new property "java2d.font.usePlatformFont=true" can be set to apply workaround for input framework testing paul.charlton@eng 1998-05-06
01-05-1998

EVALUATION composite fonts implementation not yet complete... paul.charlton@eng 1998-04-30 Paul and I worked around and Paul came to conclusion, the fix suggested above is better solution for now. The fix was delivered and tested. dmitry.feld@eng 1998-05-01
30-04-1998