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

Font.canDisplayUpTo does not work correctly with variation selectors

XMLWordPrintable

    • 2d
    • x86_64
    • windows_10

      A DESCRIPTION OF THE PROBLEM :
      Font.canDisplay(int) and Font.canDisplayUpTo do not work correctly with variation selectors.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Install some Japanese fonts for all users and run the test code.


      ---------- BEGIN SOURCE ----------
      public static void main(String[] args) {
          int cp[] = { 0x8FBB, 0xE0101 };

          String str = new String(cp, 0, cp.length);
          System.out.println(str);

          Font font = new Font(fontName, Font.PLAIN, 12);

          System.out.println(font.canDisplayUpTo(str) == -1); // => false
          System.out.println(font.canDisplay(cp[0])); // => true
          System.out.println(font1.canDisplay(cp[1])); // => false
      }
      ---------- END SOURCE ----------

            prr Philip Race
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: