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

Default text antialias setting causes bad font rendering on 125% scale

XMLWordPrintable

    • 2d
    • generic
    • windows

      A DESCRIPTION OF THE PROBLEM :
      When using 125% display scaling Tahoma size 11 font is rendered very badly.
      The issue is mostly fixed by using different text antialiasing setting.

      On my system Java has determined default antialiasing setting VALUE_TEXT_ANTIALIAS_LCD_HRGB, using VALUE_TEXT_ANTIALIAS_ON or VALUE_TEXT_ANTIALIAS_GASP improves rendering a lot.
      Even with those settings Tahoma 11 is still slightly off, especially lowercase u is rendered too wide.

      Note that this seems to be the same issue as JDK-8272632 .


      REGRESSION : Last worked in version 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Configure display scale 125%
      Run test program

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Font is rendered correctly
      ACTUAL -
      Letter spacing in text jumps in strange increments

      ---------- BEGIN SOURCE ----------

      public class Tahomatest
      {

      public static void
      main(String[] args)
              throws Exception
      {
          System.out.println("rendering hints: " + java.awt.Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
          java.awt.Frame frame = new javax.swing.JFrame("");
          javax.swing.JLabel label = new javax.swing.JLabel("Test text that looks funny");
          label.setFont(new java.awt.Font("Tahoma", java.awt.Font.PLAIN, 11));
          frame.add(label);
          frame.pack();
          frame.setVisible(true);
      }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      This improves letter spacing:
      UIManager.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);

      but some letters are still rendered too wide.

      FREQUENCY : always


        1. Tahomatest.java
          0.5 kB
        2. WithGASP_1.25.png
          WithGASP_1.25.png
          6 kB
        3. WithoutGASP_1.25.png
          WithoutGASP_1.25.png
          6 kB
        4. WithoutGASP_uiScale2.png
          WithoutGASP_uiScale2.png
          8 kB

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

              Created:
              Updated: