blob: 83933a97c8bdf542140a0e8b38b8096b1036c31c [file] [log] [blame]
From 6e7c8d30f74088ba3ba96f539bcee624fdf8b438 Mon Sep 17 00:00:00 2001
From: "David Kaspar [Dee'Kej]" <dkaspar@redhat.com>
Date: Fri, 7 Oct 2016 12:20:29 +0200
Subject: [PATCH 1/4] Fix error when using ImageMagick's convert:
Error: /undefined in .runlibfileexists
---
Resource/Init/gs_fonts.ps | 15 ++++++++++++---
Resource/Init/gs_init.ps | 9 +++++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps
index 8e361552b..686563274 100644
--- a/Resource/Init/gs_fonts.ps
+++ b/Resource/Init/gs_fonts.ps
@@ -139,10 +139,19 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put
} if
1 index type /stringtype eq
1 index type /nametype eq and 1 index xcheck and
- 1 index /run eq 2 index /.runlibfile eq or and {
+ 1 index /run eq 2 index /.runlibfile eq 3 index /.runlibfileifexists eq or or and {
% This is an inclusion entry.
- pop findlibfile { exch pop } { file } ifelse
- 2 index exch .readFontmap pop
+ 0 index /.runlibfileifexists eq {
+ pop findlibfile {
+ exch pop
+ 2 index exch .readFontmap pop
+ } {
+ pop
+ } ifelse
+ } {
+ pop findlibfile { exch pop } { file } ifelse
+ 2 index exch .readFontmap pop
+ } ifelse
} {
% This is a real entry.
% Read and pop tokens until a semicolon.
diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
index 722b57c1e..333b3cd1c 100644
--- a/Resource/Init/gs_init.ps
+++ b/Resource/Init/gs_init.ps
@@ -858,6 +858,14 @@ currentdict /.makeinternaldict .undef
{ /undefinedfilename signalerror }
ifelse
} bind def
+/runlibfileifexists
+ { % We don't want to bind 'run' into this procedure,
+ % since run may get redefined.
+ findlibfile
+ { exch pop /run .systemvar exec }
+ { pop }
+ ifelse
+ } bind def
/selectdevice
{ finddevice setdevice .setdefaultscreen } bind def
/signalerror % <object> <errorname> signalerror -
@@ -986,6 +994,7 @@ def
} bind def
% Temporarily substitute it for the real runlibfile.
/.runlibfile /runlibfile load def
+/.runlibfileifexists /runlibfileifexists load def
/runlibfile //runlibfile0 def
currentdict /runlibfile0 .undef
--
2.25.0.341.g760bfbb309-goog