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

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