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

No combining of some mark space combining Unicode characters on Mac OS X

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • tbd
    • 8u25
    • client-libs

      FULL PRODUCT VERSION :
      java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Mac OS X 10.8.5, Mac OS X 10.9.5

      A DESCRIPTION OF THE PROBLEM :
      The example code should render the two characters combinded. The problem occurs only on Mac OS X with Oracle Java 7,8 and with Apple Java 6u65.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Launch the example code on Mac OS X and another OS (Windows 7 or Linux). Compare the rendered results in the text field.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Display of combined characters.
      ACTUAL -
      The charcters are not combinded.The mark space combining character is rendered "standalone" showing the placeholder dotted circle.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Font;

      import javax.swing.JFrame;
      import javax.swing.JTextField;
      import javax.swing.SwingUtilities;

      public class MarkSpacingCombiningTest extends JTextField{

      // Unicode Character 'KHMER LETTER TA' (U+178F)
      // Category Letter, Other [Lo]
      // http://www.fileformat.info/info/unicode/char/178f/index.htm
      // and
      // Unicode Character 'KHMER VOWEL SIGN OE' (U+17BE)
      // Category Mark, Spacing Combining [Mc]
      // http://www.fileformat.info/info/unicode/char/17be/index.htm
      //
      private String exampleText="\u178F\u17BE";


          public MarkSpacingCombiningTest() {
             super();
          }
          
          protected void setExampleText() {
              Font f=getFont().deriveFont((float)80.0);
              if(f.canDisplayUpTo(exampleText)!=-1){
               // Set "Khmer UI" font on Windows 7
               f=new Font("Khmer UI",Font.PLAIN,80);
               System.out.println("Using font family Khmer UI");
              }
              setFont(f);
              setText(exampleText);
              repaint();
          }

          public static void main(String[] args) {
              final MarkSpacingCombiningTest t=new MarkSpacingCombiningTest();
              System.out.println("Java version: "+System.getProperty("java.vendor")+" "+System.getProperty("java.version"));
              Runnable sr=new Runnable() {
                  @Override
                  public void run() {
                      JFrame f =new JFrame();
                      f.getContentPane().add(t);
                      t.setExampleText();
                      f.pack();
                      f.setVisible(true);
                      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                      f.repaint();
                  }
              };
              SwingUtilities.invokeLater(sr);
          }
      }

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

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: