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

Win: Japanese logical fonts are drawn with wrong size

XMLWordPrintable

    • 2d
    • b13
    • 18
    • b24
    • generic
    • windows

      FULL PRODUCT VERSION :
      openjdk version "18" 2022-03-22
      OpenJDK Runtime Environment (build 18+36-2087)
      OpenJDK 64-Bit Server VM (build 18+36-2087, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      AWT Text shows Japanese fonts with wrong size.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Launch the sample program on Japanese Windows.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      See the attached images.
      errorJPFont.png: Japanese font is drawing with unexpected size.
      expected.png: Both English and Japanese fonts are expected.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ADDITIONAL INFORMATION:
      This issue can be related with JEP 400, UTF-8 by Default.
      When we use "-Dfile.encoding=COMAPT", this issue was gone.

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

      public class fonttest {
          public static void main(String[] args) {
              Frame f = new Frame();
              TextField t = new TextField();
              t.setText("ABC\u3042\u3044ABC");
              t.setFont(new Font(Font.SERIF, Font.PLAIN, 8));
              f.add(t);
              f.setSize(200,100);
              f.setVisible(true);
          }
      }
      ---------- END SOURCE ---------- 

        1. 30pointcase.png
          30pointcase.png
          85 kB
        2. errorJPFont.png
          errorJPFont.png
          19 kB
        3. expected.png
          expected.png
          22 kB
        4. expected30pt.png
          expected30pt.png
          90 kB
        5. fonttest.java_v2
          0.3 kB
        6. nativeappFont.png
          nativeappFont.png
          26 kB
        7. Win32Project1.cpp
          4 kB
        8. Win32Project1.cpp_v2
          4 kB

            prr Philip Race
            tnakamura Toshio Nakamura
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: