JDK-8210447 : Incorrect font rendering under Windows LAF
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 11,12
  • Priority: P3
  • Status: Closed
  • Resolution: Incomplete
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2018-09-04
  • Updated: 2019-01-24
  • Resolved: 2018-09-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12Resolved
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Microsoft Windows [Version 6.1.7601]

java version "11" 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11+28)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)


A DESCRIPTION OF THE PROBLEM :
Font rendering for the default font under Windows LAF looks strange, e.g. in JLabel. At least lowercase i and l look incorrectly aligned horizontally - it looks almost like an extra space character is rendered.

REGRESSION : Last worked in version 10.0.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached reproducer (FontBug) with sample labels.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Correctly rendered labels
ACTUAL -
Extra space in string rendering

---------- BEGIN SOURCE ----------
import java.awt.EventQueue;
import java.awt.FlowLayout;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.UIManager;

public class FontBug extends JFrame
{
   public FontBug()
   {
      super( System.getProperty( "java.runtime.version" ) );

      setDefaultCloseOperation( EXIT_ON_CLOSE );
      setLayout( new FlowLayout() );

      add( new JLabel( "Admin" ) );
      add( new JLabel( "Client" ) );
      add( new JLabel( "Identity" ) );
      add( new JLabel( "Implemented" ) );
      add( new JLabel( "without" ) );

      pack();
      setVisible( true );
   }

   public static void main( String[] args )
   {
      EventQueue.invokeLater( new Runnable()
      {
         @Override
         public void run()
         {
            try
            {
               UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
            }
            catch ( Exception e )
            {
               e.printStackTrace();
            }

            new FontBug();
         }
      } );
   }
}

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

FREQUENCY : always



Comments
> At least lowercase i and l look incorrectly aligned horizontally - it looks almost like an extra space character is rendered. What the submitter means by this is not at all clear to me. Where might I see "i" and "I" aligned ? What does "aligned" mean here ? An extra space ? You mean a space character which is (approximately) 5 or 6 pixels wide ? Or do you mean an extra PIXEL between glyphs ? I'd like all of that explained a LOT better too.
06-09-2018

Pardeep, >10.0.2: OK >11 ea b28: Fail The 10.0.2 and 11 images look identical to me. What is the output of java -version on the build used for 10.0.2 ?
06-09-2018

Font rendering looks slightly distorted when checked with JDK 11 and 12 (see attached screenshot as reference). To verify, run the attached test case with respective JDK versions. Results: ====== 8u181: OK 10.0.2: OK 11 ea b28: Fail 12 ea b9: Fail
06-09-2018