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

Text-specific antialiasing is not recognized properly

    Details

    • Subcomponent:
      2d
    • Introduced In Version:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      ADDITIONAL SYSTEM INFORMATION :
       Microsoft Windows 10 Pro Version 1803 Build 17134
      java version "1.8.0_211"
      Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
      Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)


      A DESCRIPTION OF THE PROBLEM :
      Fonts are not properly rendered when Java swing application runs on Windows 10 with 4K LCD monitor.

      The problem occurs only on JDK 8 u 211 / 212 provided by Oracle.
      It does not occur on Java 11.03 or on JDK 8 u 212 for Windows 64 bit provided by https://www.azul.com/downloads/zulu/

      REGRESSION : Last worked in version 8u192

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run given Java program

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Fonts are rendered properly and text "Text-specific antialiasing enable key : LCD HBGR antialiasing text mode" is printed to the output and shown. All letters inside the Frame are looking sharp.
      ACTUAL -
      Fonts are rendered properly and text "Text-specific antialiasing enable key : Antialiased text mode" is printed to the output and shown. All letters inside the Frame are not looking sharp.


      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.*;
      import java.util.Map;

      public class AntialiasingFontCheck implements Runnable {
          private JFrame frame;
          private JMenuBar menuBar;

          public static void main(String[] args) {
              SwingUtilities.invokeLater(new AntialiasingFontCheck());
          }

          public void run() {
              Toolkit tk = Toolkit.getDefaultToolkit();
              Map map = (Map) tk.getDesktopProperty("awt.font.desktophints");
              final Object antialiasingHint = map.get(RenderingHints.KEY_TEXT_ANTIALIASING);
              final String hint = RenderingHints.KEY_TEXT_ANTIALIASING + " : " + antialiasingHint;
              System.out.println(hint);

              frame = new JFrame();
              menuBar = new JMenuBar();

              JMenu fileMenu = new JMenu("File");
              fileMenu.setMnemonic('f');
              menuBar.add(fileMenu);
              frame.setJMenuBar(menuBar);
              final JTextArea textArea = new JTextArea();
              textArea.setText(hint);
              frame.getContentPane().add(textArea);

              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setPreferredSize(new Dimension(400, 300));
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              aivanov Alexey Ivanov
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: