diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2019-05-06 12:18:22 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2019-05-24 13:09:53 +0100 |
commit | 562019e7add37f0aa9bee6d5d6082925f0b6489c (patch) | |
tree | 3c2e76cc73169fb9bec6bdc7a865e6262407f11d | |
parent | ec11f02063c018d1ed1f32de7b25362a41d0800a (diff) | |
download | ghostpdl-562019e7add37f0aa9bee6d5d6082925f0b6489c.tar.gz |
cidfmap paths, add to PermitReading list
-rw-r--r-- | Resource/Init/gs_cidfm.ps | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/Resource/Init/gs_cidfm.ps b/Resource/Init/gs_cidfm.ps index c0237283c..5ec3d5d18 100644 --- a/Resource/Init/gs_cidfm.ps +++ b/Resource/Init/gs_cidfm.ps @@ -133,9 +133,39 @@ currentdict end def } if >> def +% <dir.../base.extn> .basename <dir> +/.splitdirname { + (/) rsearch { //true } { (\\) rsearch } ifelse + {3 -2 roll pop pop //true}{//false} ifelse +} bind def + +% <file> .addcidfmappath - +/.addcidfmpermitpath +{ + .filename + { + //.splitdirname exec + {dup def} if + } if +} bind def + /VerifyMap % <raw_map> VerifyMap - { + % This is where we insert the default fallback into the map + % checking first to see if there is a user specified alternative + dup /CIDFallBack known not{ + //DefaultCIDFallBack dup /Path get status + { + pop pop pop pop + /CIDFallBack exch 2 index 3 1 roll put + } + { + pop + }ifelse + } if + % Remove any mappings for which we cannot find the font file + dup length dict begin dup { % if we have a name1->name2 mapping, follow the "trail", @@ -163,11 +193,12 @@ currentdict end def /Path .knownget { .libfile - {closefile pop} + { + dup //.addcidfmpermitpath exec closefile pop} { {(r) file} //.internalstopped exec {pop pop 2 index exch .undef} - {closefile pop} ifelse + {dup //.addcidfmpermitpath exec closefile pop} ifelse } ifelse } {2 index exch .undef} @@ -177,19 +208,8 @@ currentdict end def } ifelse } loop } forall - - % This is where we insert the default fallback into the map - % checking first to see if there is a user specified alternative - dup /CIDFallBack known not{ - //DefaultCIDFallBack dup /Path get status - { - pop pop pop pop - /CIDFallBack exch 2 index 3 1 roll put - } - { - pop - }ifelse - } if + currentdict end + {exch pop /PermitFileReading exch .addcontrolpath} forall % Checks for vicious substitution cycles. dup length dict copy % <<map>> @@ -233,6 +253,9 @@ currentdict end def pop pop } bind def +currentdict /.splitdirname undef +currentdict /.addcidfmpermitpath undef + /PreprocessRecord % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool> { //IsMyRecord exec { |