Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8023990

Regression: postscript size increase from 6u18

    Details

    • Subcomponent:
      2d
    • Introduced In Version:
    • Resolved In Build:
      b06
    • CPU:
      generic
    • OS:
      linux_ubuntu

      Backports

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

          Issue Links

            Activity

            Hide
            prr Philip Race added a comment -
            This is out of scope for JDK 8.
            Show
            prr Philip Race added a comment - This is out of scope for JDK 8.
            Hide
            anashaty Anton Nashatyrev (Inactive) added a comment -
            https://bugs.openjdk.java.net/browse/JDK-6551584 (Need fontconfig.properties for Ubuntu)
            Show
            anashaty Anton Nashatyrev (Inactive) added a comment - https://bugs.openjdk.java.net/browse/JDK-6551584 (Need fontconfig.properties for Ubuntu)
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/90daa7f1e0e3
            User: alitvinov
            Date: 2014-02-05 16:02:50 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/90daa7f1e0e3 User: alitvinov Date: 2014-02-05 16:02:50 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/90daa7f1e0e3
            User: lana
            Date: 2014-03-25 20:49:04 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/90daa7f1e0e3 User: lana Date: 2014-03-25 20:49:04 +0000
            Hide
            afomin Alexander Fomin added a comment -
            SQE OK to take the low impact fix to CPU14_03 before RDP 2
            Show
            afomin Alexander Fomin added a comment - SQE OK to take the low impact fix to CPU14_03 before RDP 2

              People

              • Assignee:
                anashaty Anton Nashatyrev (Inactive)
                Reporter:
                anashaty Anton Nashatyrev (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: