|
|
4329f6 |
From 75de02d9065b6280482d7cd011e9462badb19f83 Mon Sep 17 00:00:00 2001
|
|
|
4329f6 |
From: Andreas Gruenbacher <agruenba@redhat.com>
|
|
|
4329f6 |
Date: Thu, 30 Jan 2020 23:08:23 +0100
|
|
|
4329f6 |
Subject: [PATCH] Recognize fractional numbers in PageSize
|
|
|
4329f6 |
|
|
|
4329f6 |
Right now, fractional numbers (fractional pt sizes) aren't allowed in
|
|
|
4329f6 |
PageSize values even though they are perfectly fine in PPD files. In
|
|
|
4329f6 |
contrast, the values foomatic puts into the *ImageableArea and
|
|
|
4329f6 |
*PaperDimension definitions it generates are fractional. So allow
|
|
|
4329f6 |
fractional numbers in PageSize values as well.
|
|
|
4329f6 |
---
|
|
|
4329f6 |
lib/Foomatic/DB.pm | 6 +++---
|
|
|
4329f6 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
4329f6 |
|
|
|
4329f6 |
diff --git a/lib/Foomatic/DB.pm b/lib/Foomatic/DB.pm
|
|
|
4329f6 |
index 90389b3..39739aa 100644
|
|
|
4329f6 |
--- a/lib/Foomatic/DB.pm
|
|
|
4329f6 |
+++ b/lib/Foomatic/DB.pm
|
|
|
4329f6 |
@@ -5533,7 +5533,7 @@ sub getppd ( $ $ $ ) {
|
|
|
4329f6 |
# option.
|
|
|
4329f6 |
my $size = $v->{'driverval'};
|
|
|
4329f6 |
if ($size =~ /([\d\.]+)x([\d\.]+)([a-z]+)\b/) {
|
|
|
4329f6 |
- # 2 positive integers separated by
|
|
|
4329f6 |
+ # 2 positive numbers separated by
|
|
|
4329f6 |
# an 'x' with a unit
|
|
|
4329f6 |
my $w = $1;
|
|
|
4329f6 |
my $h = $2;
|
|
|
4329f6 |
@@ -5551,8 +5551,8 @@ sub getppd ( $ $ $ ) {
|
|
|
4329f6 |
$w = sprintf("%.2f", $w) if $w =~ /\./;
|
|
|
4329f6 |
$h = sprintf("%.2f", $h) if $h =~ /\./;
|
|
|
4329f6 |
$size = "$w $h";
|
|
|
4329f6 |
- } elsif (($size =~ /(\d+)[x\s]+(\d+)/) ||
|
|
|
4329f6 |
- # 2 positive integers separated by
|
|
|
4329f6 |
+ } elsif (($size =~ /([\d\.]+)[x\s]+([\d\.]+)/) ||
|
|
|
4329f6 |
+ # 2 positive numbers separated by
|
|
|
4329f6 |
# whitespace or an 'x'
|
|
|
4329f6 |
($size =~ /\-dDEVICEWIDTHPOINTS\=(\d+)\s+\-dDEVICEHEIGHTPOINTS\=(\d+)/)) {
|
|
|
4329f6 |
# "-dDEVICEWIDTHPOINTS=..."/"-dDEVICEHEIGHTPOINTS=..."
|
|
|
4329f6 |
--
|
|
|
4329f6 |
2.25.4
|
|
|
4329f6 |
|