United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8023990 : Regression: postscript size increase from 6u18

Details
Type:
Bug
Submit Date:
2013-08-29
Status:
Resolved
Updated Date:
2014-09-04
Project Name:
JDK
Resolved Date:
2014-02-05
Component:
client-libs
OS:
linux_ubuntu
Sub-Component:
2d
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
8-pool
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Duplicate:
Relates:
Relates:
Relates:

Sub Tasks

Description
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
calling
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
6752622).

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
FcFontConfiguration.getFontDescriptors().

                                    

Comments
This is out of scope for JDK 8.
                                     
2013-08-29
https://bugs.openjdk.java.net/browse/JDK-6551584 (Need fontconfig.properties for Ubuntu)
                                     
2013-12-09
URL:   http://hg.openjdk.java.net/jdk9/client/jdk/rev/90daa7f1e0e3
User:  alitvinov
Date:  2014-02-05 16:02:50 +0000

                                     
2014-02-05
URL:   http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/90daa7f1e0e3
User:  lana
Date:  2014-03-25 20:49:04 +0000

                                     
2014-03-25
SQE OK to take the low impact fix to CPU14_03 before RDP 2
                                     
2014-04-14



Hardware and Software, Engineered to Work Together