From 709c52c95431dce3b583b5b2fe8a219ff398f751 Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Fri, 1 Jul 2016 13:31:46 +0200
Subject: [PATCH] PPD: Allow fractional ImageableArea and HWMargins

---
 ppd/PPD/Paper.pm    | 4 ++--
 ppd/gen-nessie-xcpt | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ppd/PPD/Paper.pm b/ppd/PPD/Paper.pm
index 46c9696..d3fc617 100644
--- a/ppd/PPD/Paper.pm
+++ b/ppd/PPD/Paper.pm
@@ -127,7 +127,7 @@ sub add_papers($) {
 			{
 				Key => $k,
 				Name => ($m->{Name} // $k),
-				PS => sprintf("%d %d %d %d", $margh, $margv, $m->{W} - $margh, $m->{H} - $margv),
+				PS => sprintf("%g %g %g %g", $margh, $margv, $m->{W} - $margh, $m->{H} - $margv),
 			}
 		} sort keys %real_media ],
 		Default => $o->{DefPaper},
@@ -151,7 +151,7 @@ sub add_papers($) {
 		[ 'LandscapeOrientation',	's',	'Plus90' ],
 		[ 'MaxMediaWidth',		'q',	$maxw ],
 		[ 'MaxMediaHeight',		'q',	$maxh ],
-		[ 'HWMargins',			's',	sprintf("%d %d %d %d", $margh, $margv, $margh, $margv) ],	# left, bottom, right, top
+		[ 'HWMargins',			's',	sprintf("%g %g %g %g", $margh, $margv, $margh, $margv) ],	# left, bottom, right, top
 	);
 
 	option({
diff --git a/ppd/gen-nessie-xcpt b/ppd/gen-nessie-xcpt
index 42e1e8b..d7a4ab5 100755
--- a/ppd/gen-nessie-xcpt
+++ b/ppd/gen-nessie-xcpt
@@ -4,6 +4,7 @@
 # FIXME: Color adjustments
 # FIXME: cupsIPPFinishings
 # FIXME: cupsSingleFile?
+# FIXME: Allow PS printing
 
 use strict;
 use warnings;
@@ -84,7 +85,7 @@ PPD::PJL::add_jcl({ PDF => 1 });
 PPD::Paper::add_papers({
 	MinW => 252, MaxW => 864,
 	MinH => 278, MaxH => 1368,
-	MarginH => 11.34, MarginV => 11.34,	# FIXME: show as floats
+	MarginH => 11.34, MarginV => 11.34,
 	JCL => 1,
 	PSPageSize => sub { my ($m) = @_; return jopt('MEDIAXSIZE', $m->{W}, 'MEDIAYSIZE', $m->{H}); },
 	PSCustomPageSize => jopt('MEDIAXSIZE', '\1', 'MEDIAYSIZE', '\2'),
-- 
GitLab