-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta
-
x86, sparc
-
solaris, solaris_7
-
Verified
Tested with jdk1.4 (build 1.4beta-B44) Solaris Japanese(Solaris2.6 x86, Solaris7 x86, Solaris7 Sparc Solaris8 Sparc).
Printing Japanese characters causes java.lang.IndexOutOfBoundsException as below;
java.lang.IndexOutOfBoundsException: range length: -7
at java.awt.Font.getStringBounds(Font.java:1526)
at java.awt.FontMetrics.getStringBounds(FontMetrics.java:506)
at sun.print.PSPrinterJob.textOut(PSPrinterJob.java:1086)
at sun.print.PSPathGraphics.drawString(PSPathGraphics.java:160)
at sun.print.PSPathGraphics.drawString(PSPathGraphics.java:108)
at PrintTest_ja$Printer.print(PrintTest_ja.java:60)
at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1441)
at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1032)
at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:937)
at PrintTest_ja.actionPerformed(PrintTest_ja.java:118)
at java.awt.Button.processActionEvent(Button.java:354)
at java.awt.Button.processEvent(Button.java:327)
at java.awt.Component.dispatchEventImpl(Component.java:3450)
at java.awt.Component.dispatchEvent(Component.java:3317)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:437)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:140)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:126)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:121)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
To reproduce,
1. Compile and run an attached test case (PrintTest_ja.java).
2. Click "Print" button.
The expected result is that the string in Japanese which means "Test using java.awt.print" is printed correctly.
This test case works correctly with jdk1.4 beta_b40 on both of Solaris Sparc and
Solaris x86.
This problme is seen from beta_b42 on Solaris Sparc (it is not reproeucible with b42 on Solaris x86 because java does not work due to another reported bug).
In case of English characters drawing, the exception does not occur and print action can be done, however, nothing is printed out.
To reproduce, please use "PrintTest.java", attached also and follow the steps above.