JDK-8214538 : Swing text rendering issue, letters either with spaces or stuck together
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 11,12
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_8
  • CPU: x86_64
  • Submitted: 2018-11-29
  • Updated: 2019-06-27
  • Resolved: 2019-06-27
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 13
13Resolved
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 8.1 (but reproducable on Windows 7/10)
OracleJDK 11.0.1 or OpenJDL 11.0.1

A DESCRIPTION OF THE PROBLEM :
In Java 11 JComponent text contains letter spacing issues in all JComponents. It is visible mostly with a capital letter followed up by non capital letter.
There were no such issues using Java 8.

I suspect this might be the cause of T2K -> FreeType scaler change.
Can be reproduced on Dialog, Arial and other fonts.

REGRESSION : Last worked in version 8u192

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
One sample: create a JLabels(or a JButtons) in a panel containing text "Editing", "Symbol styles", "Default", "Keyboard", "Active". 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There should be no additional spaces.
Behavior should be at least comparable to Java 8.
ACTUAL -
In text "Editing" there is a space between "E" and "d". 
In text "Symbol styles" there is a space between "y" and "m", and between "y" and "l"
etc.
In text "dwedwedwe" each "w" and "e" have no space at all, they are stuck together.

Both Java 11 and Java 8 use same font:
javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=bold,size=12]

---------- BEGIN SOURCE ----------
public class TestSwingTexts
{
	public static void main(String[] args)
	{
		JFrame frame = new JFrame("Java 11 example");

		JPanel panel = new JPanel();
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));

		JLabel label = new JLabel("Symbol styles");
		JLabel label2 = new JLabel("Default");
		JLabel label3 = new JLabel("Keyboard");
		JLabel label4 = new JLabel("Active");
		JButton button = new JButton("Editing");
		JButton button2 = new JButton("dwedwedwedwe");

		panel.add(label);
		panel.add(label2);
		panel.add(label3);
		panel.add(label4);
		panel.add(button);
		panel.add(button2);

		frame.add(panel);
		frame.setSize(300, 300);
		frame.setLocationRelativeTo(null);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
There are no workarounds.

FREQUENCY : always



Comments
This is fixed by JDK-8217731
27-06-2019

Regression of JDK-8193017
13-03-2019

[~psadhukhan]Yes, you are right. I did a recheck and issue does not appear in 9.
04-12-2018

As per description, JComponent text contains letter spacing issues in all JComponents when run in JDK 11. Behavior differs from JDK 8u. Checked this with provided test case, and could confirm the issue as reported. With JDK 11 and 12 ea build, there is extra space between letters or they found stuck together (See attached screenshots as reference). Results: ========= 8u191: Ok 9: Ok 11: Fail 12 ea b22: Fail This is a regression in JDK 11.
04-12-2018

I am not sure why it is mentioned it is a regression from jdk9 onwards. It was mentioned in the bug description that it is seen from jdk11. From my testing also, I found it is regressed from jdk11b05 onwards due to JDK-8193017 because of t2k to freetype change.
30-11-2018