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

Some glyphs are not rendered or rendered partially when antialiasing is enabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8u66
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • CPU:
      x86
    • OS:
      windows_8

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_66"
      Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]

      A DESCRIPTION OF THE PROBLEM :
      On Windows, when LCD antialiasing is enabled, glyphs of some fonts can be rendered only partially by JRE (or not rendered at all). For example, only one bar can be rendered for 'equals' character (=) instead of two.
      Same behavior is not observed in native applications.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Install Inconsolata font (available at http://www.levien.com/type/myfonts/inconsolata.html, direct download link - http://www.levien.com/type/myfonts/Inconsolata.otf).
      Run the sample program.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      'a=b' string is rendered in the sample application's window.
      ACTUAL -
      Something similar to 'a-b' is rendered.

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      public class Test {
          public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                  @Override
                  public void run() {
                      JFrame frame = new JFrame("Test");
                      frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                      frame.add(new MyComponent());
                      frame.setSize(200, 100);
                      frame.setVisible(true);
                      frame.setLocationRelativeTo(null);
                  }
              });
          }

          private static class MyComponent extends JComponent {
              @Override
              protected void paintComponent(Graphics g) {
                  Graphics2D g2d = (Graphics2D) g;
                  g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
                  g.setFont(new Font("Inconsolata", Font.PLAIN, 12));
                  g.drawString("a=b", 30, 30);
              }
          }
      }

      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: