JDK-8023990 : Regression: postscript size increase from 6u18
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8-pool
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: generic
  • Submitted: 2013-08-29
  • Updated: 2014-12-23
  • Resolved: 2014-02-05
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.
6u81Fixed 7u65Fixed 8u11Fixed 9 b06Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
We wish to to understand why FcFontConfiguration overrides the
getFontDiscriptors() method.  Originally the implementation of this method
was empty and then it was modified later on to return an empty
fontDescriptors array.  Understanding the reasons behind this will help us to
validate our fix proposals (removing the overriding method).
Under certain circumstances, postscript files generated by the AWT Printing
API on Linux are significantly increased from 6u17 onwards (e.g. from a few
KB to multiple MB). The problem also exists on Java 7. The reasons for the
behaviour difference seem to be different in Java 6 vs Java 7.

In Java 6, the addition of the Ubuntu fontconfig files in update 18 seems to
have introduced this issue (CR 6551584 -subCR JDK-2178357).

In Java 7 the execution flow is completely different. From our analysis of
the code, the drawString method of PSPathGraphics class calls
psPrinterJob.textOut and passes the string. If the textOut method was able to
encode the string successfully it returns true, and the generated postscript
file is of normal size. If psPrinterJob.textOut() returns false we call
super.drawString() from PSPathGraphics, and this seems to cause the increase
in the size of the postscript file.

The psPrinterJob.textOut() call returns False when makeMultiCharsetString()
returns NULL. In PlatformFont.java, the ComponentFonts array was NULL, hence
the input String encoding was not successful. ComponentFonts is obtained by
fontConfig.getFontDescriptors(familyName, style).

In Java 7, fontConfig is FcFontConfiguration which has getFontDescriptors
defined to return an empty FontDescriptor array.(Oracle bug id 6378099 and

In Java 6, fonfConfig is MFontConfiguration and it does not implement
getFontDescriptors and calls FontConfiguration.getFontDescriptors() to obtain
the font descriptors.

When we remove the implementation of getFontDescriptors in
FcFontConfiguration the size of the generated postscript file is normal.
Originally FcFontConfiguration.getFontDescriptors() was not implemented.
Perhaps the intention was to specify some functionality here at some point in
the future, but it ended up being modified to return an empty font descriptor
array under the fix for CR 6752622.

We feel that either the implementation of
FcFontConfiguration.getFontDescriptors() should be removed so that
FontConfiguration.getFontDescriptors() is called instead. However, it is not
clear what the original intentions were/are for

SQE OK to take the low impact fix to CPU14_03 before RDP 2

https://bugs.openjdk.java.net/browse/JDK-6551584 (Need fontconfig.properties for Ubuntu)

This is out of scope for JDK 8.