Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7183458

Metrics of space character in algorithmically emboldened font have changed in JDK 7.

    Details

    • Subcomponent:
      2d
    • Introduced In Build:
      b28
    • Introduced In Version:
      7
    • Resolved In Build:
      b49
    • CPU:
      generic
    • OS:
      generic

      Backports

        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;
             }
        }
         
        }

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  prr Philip Race
                  Reporter:
                  prr Philip Race
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: