25f6510
From ea8addd686889af76d70031998680196913243ec Mon Sep 17 00:00:00 2001
25f6510
From: "David Kaspar [Dee'Kej]" <dkaspar@redhat.com>
25f6510
Date: Fri, 7 Oct 2016 12:20:29 +0200
25f6510
Subject: [PATCH 1/2] Fix error when using ImageMagick's convert:
25f6510
25f6510
  Error: /undefined in .runlibfileexists
25f6510
---
25f6510
 Resource/Init/gs_fonts.ps | 15 ++++++++++++---
25f6510
 Resource/Init/gs_init.ps  |  9 +++++++++
25f6510
 2 files changed, 21 insertions(+), 3 deletions(-)
25f6510
25f6510
diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps
25f6510
index a3da615..77814b8 100644
25f6510
--- a/Resource/Init/gs_fonts.ps
25f6510
+++ b/Resource/Init/gs_fonts.ps
25f6510
@@ -96,10 +96,19 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put
a70c402
                 % stack: dict file fontname filename|aliasname
a70c402
       1 index type /stringtype eq
a70c402
       1 index type /nametype eq and 1 index xcheck and
a70c402
-      1 index /run eq 2 index /.runlibfile eq or and {
a70c402
+      1 index /run eq 2 index /.runlibfile eq 3 index /.runlibfileifexists eq or or and {
a70c402
                 % This is an inclusion entry.
a70c402
-        pop findlibfile { exch pop } { file } ifelse
a70c402
-        2 index exch .readFontmap pop
a70c402
+        0 index /.runlibfileifexists eq {
a70c402
+          pop findlibfile {
a70c402
+            exch pop
a70c402
+            2 index exch .readFontmap pop
a70c402
+          } {
a70c402
+            pop
a70c402
+          } ifelse
a70c402
+        } {
a70c402
+          pop findlibfile { exch pop } { file } ifelse
a70c402
+          2 index exch .readFontmap pop
a70c402
+        } ifelse
a70c402
       } {
a70c402
                 % This is a real entry.
a70c402
                 % Read and pop tokens until a semicolon.
25f6510
diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
25f6510
index ab7cfed..f9e035b 100644
25f6510
--- a/Resource/Init/gs_init.ps
25f6510
+++ b/Resource/Init/gs_init.ps
25f6510
@@ -689,6 +689,14 @@ systemdict /internaldict dup .makeinternaldict .makeoperator
2982191
            { /undefinedfilename signalerror }
2982191
           ifelse
2982191
         } bind def
3e4c6fe
+/runlibfileifexists
2982191
+        {		% We don't want to bind 'run' into this procedure,
2982191
+                        % since run may get redefined.
2982191
+          findlibfile
2982191
+           { exch pop /run .systemvar exec }
2982191
+           { pop }
2982191
+          ifelse
2982191
+        } bind def
3e4c6fe
 /selectdevice
2982191
         { finddevice setdevice .setdefaultscreen } bind def
3e4c6fe
 /signalerror		% <object> <errorname> signalerror -
25f6510
@@ -857,6 +865,7 @@ userdict /.currentresourcefile //null put
2982191
         } bind def
3e4c6fe
 % Temporarily substitute it for the real runlibfile.
3e4c6fe
 /.runlibfile /runlibfile load def
2050c98
+/.runlibfileifexists /runlibfileifexists load def
3e4c6fe
 /runlibfile /runlibfile0 load def
3e4c6fe
 
3e4c6fe
 % Create the error handling machinery.
25f6510
-- 
25f6510
2.7.4
25f6510
25f6510
25f6510
From 9878f41a229c67aba2e62ee7ab22ff37c2e5a04f Mon Sep 17 00:00:00 2001
25f6510
From: "David Kaspar [Dee'Kej]" <dkaspar@redhat.com>
25f6510
Date: Fri, 7 Oct 2016 12:57:06 +0200
25f6510
Subject: [PATCH 2/2] Make sure customizations to
25f6510
 /etc/ghostscript/Fontmap.local are used
25f6510
25f6510
  For more info, see: https://bugzilla.redhat.com/show_bug.cgi?id=610301
25f6510
---
25f6510
 Resource/Init/Fontmap | 2 ++
25f6510
 1 file changed, 2 insertions(+)
25f6510
25f6510
diff --git a/Resource/Init/Fontmap b/Resource/Init/Fontmap
25f6510
index ae5af96..72aeb1f 100644
25f6510
--- a/Resource/Init/Fontmap
25f6510
+++ b/Resource/Init/Fontmap
25f6510
@@ -2,3 +2,5 @@
25f6510
 % See Fontmap.GS for the syntax of real Fontmap files.
25f6510
 %% Replace 1 (Fontmap.GS)
25f6510
 (Fontmap.GS) .runlibfile
25f6510
+% must be at the bottom of line to allow people overriding everything.
25f6510
+(Fontmap.local) .runlibfileifexists
25f6510
-- 
25f6510
2.7.4
25f6510