JDK-7158350 : [macosx] Strange results of SwingUIText printing
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2012-04-02
  • Updated: 2014-02-05
  • Resolved: 2012-09-27
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.
JDK 7 JDK 8
7u40Fixed 8 b61Fixed
Related Reports
Relates :  
Description
Mac OS X 10.7.3, macmini4,1
Try to run closed/java/awt/printPrinterJob/SwingUIText.java test. It is broken as a jtreg test (6970771) but one can run it directly by compiling and using its main().
It does create some JEditorPane, fills it with Latin and Arabic text -- you may find the JFrame somewhere at the bottom of windows stack and look at it. The test displays a print dialog: please print and look at the printout. 

I've attached printout from JDK8 on Linux and JDK7u4 on Mac (photocopies of the paper pages). My paper is A4 so disregard the clipped right side; on Letter it should fit better. You see that on Mac it prints almost nothing: light gray background, one Arabic symbol, and a table at the bottom.

Comments
This bug is caused by mismatched Save and Restore of context graphics state. The effect of this is wrong position of the succeeding text. It gets misplaced in the next line causing it to be not visible in the JTextArea.
27-09-2012

EVALUATION Prints fine when all text are in Latin. So this must be in how Swing handles Arabic text.
15-06-2012

EVALUATION The test is a conforming jtreg manual test. It should run fine in jtreg unless jtreg has changed in an incompatible way since the test was written. I don't know what the bug is but it could be a problem either in Swing or in printing.
05-04-2012