cups-filters icon indicating copy to clipboard operation
cups-filters copied to clipboard

PPD file generator: Support more than 2 Apple Raster resolutions

Open dkosovic opened this issue 2 years ago • 6 comments

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.

dkosovic avatar Jun 14 '23 06:06 dkosovic

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.

dkosovic avatar Jun 14 '23 06:06 dkosovic

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.

lbschenkel avatar Jun 16 '23 12:06 lbschenkel

Thanks for the confirmation that this one works, @lbschenkel !

tillkamppeter avatar Jun 16 '23 22:06 tillkamppeter

I've squashed the previous 4 commits of this pull-request into one, I think this new commit is ready.

dkosovic avatar Jul 03 '23 04:07 dkosovic

Do we have anything pending that prevents this from being merged?

lbschenkel avatar Aug 04 '23 08:08 lbschenkel

Hi @tillkamppeter, is there any blocker for getting this merged? Anything I can do to help?

lbschenkel avatar Dec 09 '23 07:12 lbschenkel