[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-2d-dev
Subject: [OpenJDK 2D-Dev] Integrated: 8256264: Printed GlyphVector outline with low DPI has bad quality on Wi
From: Alexander Scherbatiy <alexsch () openjdk ! java ! net>
Date: 2020-12-04 9:05:58
Message-ID: gvFhv86yLNiax9ecuug26UQrhVApsOdFJfE1lqQrrJE=.c48adb6d-e8dd-4392-a6e4-e61c31b09060 () github ! com
[Download RAW message or body]
On Thu, 12 Nov 2020 10:32:16 GMT, Alexander Scherbatiy <alexsch@openjdk.org> wrote:
> Printing text using GlyphVector outline has bad quality on printers with low DPI on \
> Windows. The GDI system used for text printing on Windows accepts only integer path \
> coordinates. Rounding GlyphVector outline coordinates leads to distorted printed \
> text.
> To reproduce the issue run the \
> [PrintGlyphVectorOutlineSample](https://bugs.openjdk.java.net/secure/attachment/91398/PrintGlyphVectorOutlineSample.java) \
> file on Windows and select a low DPI printer in the printer dialog. The sample \
> prints two lines, one using Graphics drawString() method and another by filling \
> GlyphVector outline. Chars on the second line are distorted.
> It is also possible to reproduce the issue running the sample and printing the text \
> to PDF: [fill-glyph-vector-outline.png](https://bugs.openjdk.java.net/secure/attachment/91397/fill-glyph-vector-outline.png)
>
> The proposed fix introduce "sun.java2d.print.enablePathPrecisionScale" property \
> which being enabled scales the GDI WorldTransform down and GlyphVector outline \
> coordinates up. This allows to keep some digits after a dot from being rounded.
> The value for scaling is chosen to be 1000 in the same way how it is used by \
> `String trunc(float f)` method from PSPrinterJob class on Linux: \
> https://github.com/openjdk/jdk/blob/ed615e3ca0d681e8e67cdbf1d5d964979ccd7888/src/java.desktop/share/classes/sun/print/PSPrinterJob.java#L1489
>
> See the [fill-glyph-vector-outline-enable-path-scale-factor.png](https://bugs.openj \
> dk.java.net/secure/attachment/91399/fill-glyph-vector-outline-enable-path-scale-factor.png) \
> screenshot which shows how the GlyphVector outline is filled after the fix with the \
> enabled "sun.java2d.print.enablePathPrecisionScale" option.
> [fill-glyph-vector-outline-diff.png](https://bugs.openjdk.java.net/secure/attachment/91400/fill-glyph-vector-outline-diff.png) \
> shows difference of GlyphVector outline printing before and after the fix.
This pull request has now been integrated.
Changeset: d6dd440c
Author: Alexander Scherbatiy <alexsch@openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/d6dd440c
Stats: 470 lines in 4 files changed: 459 ins; 0 del; 11 mod
8256264: Printed GlyphVector outline with low DPI has bad quality on Windows
Reviewed-by: serb
-------------
PR: https://git.openjdk.java.net/jdk/pull/1183
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic