summaryrefslogtreecommitdiff
path: root/ghostscript-9.54.0-ESC-Page-driver-does-not-set-page-size-correctly.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-05 02:10:58 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-05 02:10:58 +0000
commitf96ee78a68b048d59bb11f341d5c33f18cc0681e (patch)
treeb3b8295d60bb932639f129e49e3418434fac1be4 /ghostscript-9.54.0-ESC-Page-driver-does-not-set-page-size-correctly.patch
parent94e10932b4cd6123ac097ead1f72ccee89450e19 (diff)
automatic import of ghostscriptopeneuler24.03_LTS
Diffstat (limited to 'ghostscript-9.54.0-ESC-Page-driver-does-not-set-page-size-correctly.patch')
-rw-r--r--ghostscript-9.54.0-ESC-Page-driver-does-not-set-page-size-correctly.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/ghostscript-9.54.0-ESC-Page-driver-does-not-set-page-size-correctly.patch b/ghostscript-9.54.0-ESC-Page-driver-does-not-set-page-size-correctly.patch
new file mode 100644
index 0000000..1bf4e71
--- /dev/null
+++ b/ghostscript-9.54.0-ESC-Page-driver-does-not-set-page-size-correctly.patch
@@ -0,0 +1,22 @@
+diff -x .git -Napur ghostscript-9.27.old/contrib/japanese/gdevespg.c ghostscript-9.27.new/contrib/japanese/gdevespg.c
+--- ghostscript-9.27.old/contrib/japanese/gdevespg.c 2019-04-04 00:43:14.000000000 -0700
++++ ghostscript-9.27.new/contrib/japanese/gdevespg.c 2023-01-24 11:25:32.588189093 -0800
+@@ -273,6 +273,9 @@
+ int width, height, w, h, wp, hp, bLandscape;
+ EpagPaperTable *pt;
+
++ /* Page size match tolerance in points */
++ #define TOL 5
++
+ width = (int)pdev->MediaSize[0];
+ height = (int)pdev->MediaSize[1];
+
+@@ -291,7 +294,7 @@
+ }
+
+ for (pt = epagPaperTable; pt->escpage > 0; pt++)
+- if (pt->width == w && pt->height == h)
++ if (abs(w - pt->width) <= TOL && abs(h - pt->height) <= TOL)
+ break;
+
+ gp_fprintf(fp, "%c%d", GS, pt->escpage);