|
0 |
From: Andreas Gruenbacher <agruenba@redhat.com>
|
|
1 |
Date: Sun, 12 Apr 2020 00:01:14 +0200
|
|
2 |
Subject: Get rid of PageSize rounding
|
|
3 |
|
|
4 |
Until January 31, 2020, the foomatic parser didn't recognize values with
|
|
5 |
fractional numbers like "9.6 2834.65" in PageSize values, so we were rounding
|
|
6 |
here. With the fix from here:
|
|
7 |
|
|
8 |
https://github.com/OpenPrinting/foomatic-db-engine/commit/75de02d
|
|
9 |
|
|
10 |
we can get rid of the rounding in ptouch-driver, and the page sizes will be a
|
|
11 |
lot more accurate.
|
|
12 |
---
|
|
13 |
foomaticalize | 16 ----------------
|
|
14 |
1 file changed, 16 deletions(-)
|
|
15 |
|
|
16 |
diff --git a/foomaticalize b/foomaticalize
|
|
17 |
index bedb129..e3bad19 100755
|
|
18 |
--- a/foomaticalize
|
|
19 |
+++ b/foomaticalize
|
|
20 |
@@ -198,22 +198,6 @@ sub transform($) {
|
|
21 |
$printer->appendChild($id);
|
|
22 |
}
|
|
23 |
}
|
|
24 |
- foreach my $option ($dom->findnodes('/option')) {
|
|
25 |
- next unless $option->findvalue('./arg_shortname/en') eq 'PageSize';
|
|
26 |
- foreach my $enum ($option->findnodes('./enum_vals/enum_val')) {
|
|
27 |
- foreach my $driverval ($enum->findnodes('./ev_driverval')) {
|
|
28 |
- # Until January 31, 2020, the foomatic parser didn't
|
|
29 |
- # recognize values with fractional numbers like
|
|
30 |
- # "9.6 2834.65" in PageSize values. Until that fix is
|
|
31 |
- # available widely enough, round the numbers.
|
|
32 |
- if ($driverval->textContent =~
|
|
33 |
- /^\s*(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)\s*$/) {
|
|
34 |
- $driverval->removeChildNodes();
|
|
35 |
- $driverval->appendText(round($1) . ' ' . round($2));
|
|
36 |
- }
|
|
37 |
- }
|
|
38 |
- }
|
|
39 |
- }
|
|
40 |
}
|
|
41 |
}
|
|
42 |
|