PPD file generator: Support more than 2 Apple Raster resolutions
Backport of https://github.com/OpenPrinting/libppd/commit/0b2ca66bd05966bd1bd4838b9d79be6f83141afc to cups-filters 1.x.
Which does the following for cupsPrintQuality and Apple Raster resolutions: Draft Quality: Lowest resolution High Quality: Highest resolution Normal Quality: If there is printer-default-resolution and this resolution is in the list, use it. If not, use the "middle" one, rounding down if the number of available resolutions is even.
A few comments about coding style and indentation.
Assume tab is equivalent of 8 spaces.
Ensure same kind of whitespaces for opening and closings of indent levels.
Majority of existing coding style in the vicinity was :
if (...) {
...
}
So kept that coding style even if it overrode some existing code that wasn't.
Replaced C++/C99 // style comments from original PR with /* ... */ style as used elsewhere in the code.
I was the original submitter of this issue: https://github.com/OpenPrinting/libppd/issues/2
I compiled this from source and I confirm that the PPD generator works as intended: here's the diff between stock 1.x and this branch:
--- stock.ppd 2023-06-16 14:11:05.316132496 +0200
+++ pr.ppd 2023-06-16 14:10:56.266002577 +0200
@@ -141,12 +141,12 @@
*OutputBin FaceDown/Face Down: ""
*PageStackOrder FaceDown: Normal
*CloseUI: *OutputBin
-*DefaultResolution: 1200dpi
+*DefaultResolution: 600dpi
*OpenUI *cupsPrintQuality/Print Quality: PickOne
*OrderDependency: 10 AnySetup *cupsPrintQuality
*DefaultcupsPrintQuality: Normal
*cupsPrintQuality Draft/Draft: "<</HWResolution[300 300]>>setpagedevice"
-*cupsPrintQuality Normal/Normal: "<</HWResolution[1200 1200]>>setpagedevice"
+*cupsPrintQuality Normal/Normal: "<</HWResolution[600 600]>>setpagedevice"
*cupsPrintQuality High/High: "<</HWResolution[1200 1200]>>setpagedevice"
*CloseUI: *cupsPrintQuality
*OpenUI *print-scaling/Print Scaling: PickOne
Thank you so much for backporting this.
Thanks for the confirmation that this one works, @lbschenkel !
I've squashed the previous 4 commits of this pull-request into one, I think this new commit is ready.
Do we have anything pending that prevents this from being merged?
Hi @tillkamppeter, is there any blocker for getting this merged? Anything I can do to help?