JDK-6784965 : Printing JTable using Sans Serif 11pt is broken
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u10,7,9
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS:
    linux,solaris,windows_vista,windows_7 linux,solaris,windows_vista,windows_7
  • CPU: x86
  • Submitted: 2008-12-15
  • Updated: 2018-09-05
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
tbdUnresolved
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java 1.6.0_10

ADDITIONAL OS VERSION INFORMATION :
Windows Vista Business SP1

EXTRA RELEVANT SYSTEM CONFIGURATION :
Also observed on Windows XP

A DESCRIPTION OF THE PROBLEM :
When printing JTable with renderers of any kind that use the font Font.SANS_SERIF, 11pt, PLAIN,  the characters in cells overlaps with each other (within the same cell)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See source code

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Displayed text in cells should not overlap
ACTUAL -
In many cases, particularly with upper case characters, text in completely garbled, with characters overlapping each other

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public static void main(String[] x)
  {
    try
    {
      JTable table = new JTable(1, 1);
      table.setValueAt("CURR ASSETS-CASH", 0, 0);
      table.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
      /*text appears fine in table in option pane*/
      JOptionPane.showMessageDialog(null, new JScrollPane(table));
      /*text overlaps*/
      table.print();
      System.exit(0);
    }
    catch(PrinterException ex)
    {
      ex.printStackTrace();
    }
  }
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
The only workaround is to use a font such as Lucida Sans or Tahoma which is somewhat similar but seems not to have the same problems when printing

Release Regression From : 6u7
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
The spacing part of the 8055867 is the same as this issue.
31-08-2016

The issue described in https://bugs.openjdk.java.net/browse/JDK-8055867 seems to be a duplicate of this issue.
31-08-2016

RT NOTE: Client (bulk) The criteria for deferral bulk request bugs: - Not P2 - Not tck-red - Not critical to customer Approved.
11-10-2013

jdk8: SQE OK to defer
07-10-2013

Defer notes: There is a visual issue here in a particular scenario when printing and whilst a regression its not a new one. My sense is that this is an issue in TextLayout.getJustifiedLayout() which may be non-trivial to fix. Since the issue isn't new I'd prefer that this be deferred. Regardless, I don't think it can be fixed before ZBB.
04-10-2013

isn't a regression from jdk8 pov
02-10-2013

EVALUATION Looks like caused by fix for 6488219.
03-03-2009

EVALUATION Possibly related to 6784397
17-12-2008