JDK-6921593 : Chinese Font PMingLiu not rendered correctly
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u10,6u17,6u18
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp,windows_vista
  • CPU: x86
  • Submitted: 2010-02-01
  • Updated: 2010-07-07
  • Resolved: 2010-07-07
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.
Other Other Other Other Other JDK 6 JDK 7
1.4.2_25-revFixed 1.4.2_26-revFixed 1.4.2_27Fixed 5.0u24-revFixed 5.0u25Fixed 6u19Fixed 7Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
PMingLiu font is installed properly.

A DESCRIPTION OF THE PROBLEM :
The chinese font "PMingLiu" not rendered correctly after update to 1.6.0_u17 from 1.6.0_u15.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the program, you should see a correct rendering of the four label with text "supplier name chinese".

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compile and run the program, you should see a correct rendering of the four label with text "supplier name chinese".
ACTUAL -
font size with 14.0f and 18.0f cannot be rendered correctly.
Usually, only left the text "s    r    c   s     "

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.Font;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class FontScaleTester {
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		JPanel panel = (JPanel) frame.getContentPane();
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		Box box = Box.createVerticalBox();

		box.add(createLabel("PMingLiu", 12.0f));
		box.add(createLabel("PMingLiu", 14.0f));
		box.add(createLabel("PMingLiu", 16.0f));
		box.add(createLabel("PMingLiu", 18.0f));
		panel.add(box);
		frame.pack();
		frame.setVisible(true);

	}

	static JLabel createLabel(String fontname, float size) {
		JLabel label = new JLabel("supplier name chinese");
		Font newFont = new Font(fontname, Font.PLAIN, 12).deriveFont(size);
		label.setFont(newFont);
		return label;
	}
}

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

CUSTOMER SUBMITTED WORKAROUND :
I don't have any workaround yet. Please fix it.

Release Regression From : 6u15
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION This problem is caused by fix for 6815780. We used to check for "any of glyph contours has at least on point" but after moving this condition into the loop we now check for "ALL glyph contours have at least one point". Apparently some glyphs have occasional empty contours, including some versions of MingLiu font.
02-02-2010

EVALUATION I can reporduce this with 6u18 using MingLiu font from WinXP. Interestingly but Vista has next revision of the font and it does not have this issue ...
02-02-2010