JDK-6919612 : Incorrectly Monospaced font rendering with JRE 1.6.0_17 & above
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u10,6u17
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2010-01-25
  • Updated: 2011-02-16
  • Resolved: 2010-02-04
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]



A DESCRIPTION OF THE PROBLEM :
    The attached program runs incorrectly with JRE 1.6.0_17 or above on Traditional Chinese Windows XP. Some characters are invisible when smaller-sized or bigger-sized monospaced fonts are used. It runs normally with English WinXP or JRE version prior to 1.6.0_17.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the test case source code below.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
All characters are  visible when rendered with any font size and any font name.
ACTUAL -
Some characters are invisible when rendered with smaller-sized or bigger-sized monospaced fonts.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.JLabel;
import javax.swing.BoxLayout;
public class JreFontBug extends javax.swing.JFrame {
  public static void main(String[] args) {
    JreFontBug inst = new JreFontBug();
    inst.setVisible(true);
  }
  public JreFontBug() {
    super();
    initGUI();
  }
  private void initGUI() {
    try {
      BoxLayout thisLayout = new BoxLayout(this.getContentPane(), javax.swing.BoxLayout.Y_AXIS);
      this.getContentPane().setLayout(thisLayout);
      for (int size = 6; size < 24; size++) {
        {
          JLabel jLabel1 = new JLabel();
          this.getContentPane().add(jLabel1);
       //  jLabel1.setFont(new java.awt.Font("Dialog",0,size)); // is OK
       jLabel1.setFont(new java.awt.Font("Monospaced", 0, size)); // is ERROR
          jLabel1.setText("1234567890-=~!@#$%^&*()_+ABCDEFGHIJKLMNOPQRSTUVWXYZ");
         }
      }
        setSize(500, 500);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Use JRE version prior to 1.6.0_17

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