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

Win: Japanese logical fonts are drawn with wrong size

    XMLWordPrintable

Details

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

    Description

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

      Attachments

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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: