RFR: 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS [v3]
GennadiyKrivoshein
duke at openjdk.org
Thu Nov 28 07:14:28 UTC 2024
> This update allows users to print with grayscale using color printers.
> Actually, it is not possible to use the "Monochrome" option from the "Color Appearance" panel. Also Chromaticity.MONOCHROME can't be used to print grayscale on color printers ([JDK-8315113](https://bugs.openjdk.org/browse/JDK-8315113)).
>
> **Fix description**
> When a printer supports color printing and a user adds Chromaticity.MONOCHROME attribute to a PrintRequestAttributeSet, then the final printing raster is transformed to the grayscale color using java.awt.image.ColorConvertOp. When the job is a PostScript job, then the "setColor" and "setPaint" methods of the Graphics are overridden, and user colors (paints) are transformed to the grayscale form using the new proxy class GrayscaleProxyGraphics2D.
>
> This approach is assumed to be platform, CUPS, and IPP protocol independent.
>
> **Tests**
> The fix was tested on Ubuntu 22.04 and MacOS 12.6.1.
GennadiyKrivoshein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:
- Merge remote-tracking branch 'openjdk/master' into monochrome-printing
- move grayscale methods to PSPathGraphics
- Update src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
- update copyright
- formatting
- grammar fixes
- 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/21930/files
- new: https://git.openjdk.org/jdk/pull/21930/files/1ef13568..5523e22a
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=21930&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=21930&range=01-02
Stats: 111606 lines in 2941 files changed: 30384 ins; 71570 del; 9652 mod
Patch: https://git.openjdk.org/jdk/pull/21930.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21930/head:pull/21930
PR: https://git.openjdk.org/jdk/pull/21930
More information about the client-libs-dev
mailing list