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

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