United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7183458 Metrics of space character in algorithmically emboldened font have changed in JDK 7.
JDK-7183458 : Metrics of space character in algorithmically emboldened font have changed in JDK 7.

Details
Type:
Bug
Submit Date:
2012-07-11
Status:
Resolved
Updated Date:
2013-05-22
Project Name:
JDK
Resolved Date:
2012-07-24
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
The following test program shows different metrics between JDK 6 and JDK 7
Its extreme if you use the "all spaces" string.
Note run on Windows as its using a Windows font.


import javax.swing.*;
import java.awt.Font;
import java.awt.*;

public class Gulim extends JComponent {

  public static void main(String args[]) {
    JFrame frame = new JFrame("Korean font test");
    frame.setBounds(100, 100, 600, 500);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(new Gulim());
   frame.setVisible(true);
}
public Dimension getPreferredSize() {
  return new Dimension(600,500);
}
public void paintComponent(Graphics g) {

     
     int y=20;
      String text = " X. ABCDEFGabcdefg What type of request do you want to run?";
      //String text = "ZX.ZABCDEFGabcdefgZWhatZtypeofZrequestZdoZyouZwantZtoZrun?";
      //String text = "                                                      ";
      for (int sz=9; sz<18;sz++) {
         Font f = new Font("Gulim", Font.BOLD, sz);
         g.setFont(f);
         String s = text + " " + Integer.valueOf(sz);
         g.drawString(s, 0, y);
         y+=sz+2;
     }
}
 
}

                                    

Comments
EVALUATION

JDK 7 is now widening
the advance of all spaces in algorithmically emboldened fonts.

You can debate whether spaces can/should be widened in such a
case but that was not the intention here.

The behaviour can be traced back to JDK 7 b28, and a fix from
May 2008 - over 4 years ago.
6686365: bolded zero width space has non zero width in FM or LCD modes

Unfortunately looking at the webrev discussion :-
and then looking at the actual code in JDK today, it appears that
version 0 of the fix was accidentally pushed instead of version 1.

And version 0 was wrong because it would cause this problem ..
                                     
2012-07-11
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/jdk/rev/a18a547546a4
                                     
2012-08-14



Hardware and Software, Engineered to Work Together