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

Printed GlyphVector outline with low DPI has bad quality on Windows

XMLWordPrintable

    • 2d
    • b17
    • generic
    • windows

        Printing text using GlyphVector outline has bad quality on printers with low DPI on Windows OS.
        The GDI system used for text printing on Windows accepts only integer path coordinates.
        Rounding GlyphVector outline coordinates leads to distorted printed text.

        The issue had been reported as JDK-8256264 but was reverted because of the regression JDK-8259007 "This test printed a blank page".

        The regression is in the code WPathGraphics.deviceDrawLine() method which uses wPrinterJob.moveTo() and wPrinterJob.lineTo() methods without wPrinterJob.beginPath() and wPrinterJob.endPath() methods.

        The fix JDK-8256264 used wPrinterJob.beginPath()/endPath() methods to scale transform down and wPrinterJob.moveTo()/lineTo() to scale coordinates up.

        Using wPrinterJob.beginPath()/endPath() in WPathGraphics.deviceDrawLine() method leads that a line is not drawn at all (probably GDI treat it as an empty path).

        The proposed solution is to scale coordinates up and transform down only for WPathGraphics.convertToWPath() method which draws a general path.

              alexsch Alexandr Scherbatiy
              alexsch Alexandr Scherbatiy
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: