Blame SOURCES/ghostscript-9.27-ESC-Page-driver-does-not-set-page-size-correctly.patch

e7f2e2
diff -x .git -Napur ghostscript-9.27.old/contrib/japanese/gdevespg.c ghostscript-9.27.new/contrib/japanese/gdevespg.c
e7f2e2
--- ghostscript-9.27.old/contrib/japanese/gdevespg.c	2019-04-04 00:43:14.000000000 -0700
e7f2e2
+++ ghostscript-9.27.new/contrib/japanese/gdevespg.c	2023-01-24 11:25:32.588189093 -0800
e7f2e2
@@ -273,6 +273,9 @@ escpage_paper_set(gx_device_printer * pd
e7f2e2
     int width, height, w, h, wp, hp, bLandscape;
e7f2e2
     EpagPaperTable *pt;
e7f2e2
 
e7f2e2
+    /* Page size match tolerance in points */
e7f2e2
+    #define TOL 5
e7f2e2
+
e7f2e2
     width = pdev->MediaSize[0];
e7f2e2
     height = pdev->MediaSize[1];
e7f2e2
 
e7f2e2
@@ -291,7 +294,7 @@ escpage_paper_set(gx_device_printer * pd
e7f2e2
     }
e7f2e2
 
e7f2e2
     for (pt = epagPaperTable; pt->escpage > 0; pt++)
e7f2e2
-        if (pt->width == w && pt->height == h)
e7f2e2
+      if (abs(w - pt->width) <= TOL && abs(h - pt->height) <= TOL)
e7f2e2
             break;
e7f2e2
 
e7f2e2
     fprintf(fp, "%c%d", GS, pt->escpage);