diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2024-03-08 01:38:52 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2024-03-08 01:38:52 +0000 |
commit | 9fbffcd0921a99f641de4cf11d25fb17749cca09 (patch) | |
tree | 24856d1fe2cbae81dbc7746153104863af68cc24 /Master/tlpkg/tlgs/Resource | |
parent | ec724927af1a4cd789b6b8e4ce76ee10498ee84f (diff) |
gs 10.03.0
git-svn-id: svn://tug.org/texlive/trunk@70494 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlgs/Resource')
33 files changed, 1012 insertions, 843 deletions
diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps b/Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps index 59478d94102..a44d597da3d 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_btokn.ps @@ -156,14 +156,14 @@ mark /marktype 1 index /nulltype 1 index /booleantype 1 index - /nametype { length add } .bind + /nametype { length add } .forcebind /stringtype 1 index /arraytype 0 % replaced below /dicttype 0 % replaced below .dicttomark def /.cntobj { dup type //cntdict exch get exec -} .bind def +} .forcebind def cntdict /arraytype { dup length % #refs #chars array len 4 -1 roll add % #chars array #refs+len @@ -172,11 +172,11 @@ cntdict /arraytype { } if 3 1 roll % #refs+len #chars array //.cntobj forall -} .bind put % replace arraytype in cntdict +} .forcebind put % replace arraytype in cntdict cntdict /dicttype { /writeobject .systemvar /typecheck signalerror -} bind put +} .internalbind put /.bosheader { % <top_length> <total_length> <string8> .bosheader @@ -198,7 +198,7 @@ cntdict /dicttype { } if 2 index 3 3 -1 roll put 1 index 2 3 -1 roll put -} .bind def +} .forcebind def /.writeobjects { % <file> <tag> <array> .writeobjects - % Apply the tag early and forget about it. @@ -269,7 +269,7 @@ cntdict /dicttype { } for cleartomark % Clean up -} .bind def +} .forcebind def /.writeobject { 3 copy exch @@ -277,7 +277,7 @@ cntdict /dicttype { % to avoid a possible invalidaccess. .currentglobal //false .setglobal exch 1 array astore exch .setglobal //.writeobjects exec pop pop pop -} .bind def +} .forcebind def /printobject { % <obj> <tag> printobject - currentobjectformat 0 eq { @@ -299,7 +299,7 @@ cntdict /dicttype { % This is a pseudo-operator so it will restore the stack % if it gets an error. mark 0 0 3 .argindex //.cntobj exec cleartomark pop -} bind def +} .internalbind def /.printerror { $error /binary get .languagelevel 2 ge and { currentobjectformat 0 ne { @@ -315,7 +315,7 @@ cntdict /dicttype { } //.printerror % known to be a procedure ifelse -} bind def +} .internalbind def currentdict /cntdict .undef diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cff.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cff.ps index 212ace8bf31..9f6f7b56cce 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cff.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cff.ps @@ -52,7 +52,7 @@ exch 3 -1 roll 1 add 16 mul 12 add sub f exch subfilefilter flushfile % skip to start f exch subfilefilter end -} .bind executeonly odef +} .forcebind odef % <file> .init_otto_font_file <file> /.init_wOFF_otto_font_file { @@ -88,7 +88,7 @@ { exch pop f exch subfilefilter} { pop f exch subfilefilter /FlateDecode filter} ifelse end -} bind def +} .internalbind def % <file> .loadfontfile - /.loadnonottofontfile /.loadfontfile load def @@ -115,7 +115,7 @@ % Not a TrueType font. .loadnonottofontfile } ifelse -} bind executeonly def +} .internalbind def currentdict /.init_wOFF_otto_font_file .forceundef @@ -125,12 +125,12 @@ currentdict /.init_wOFF_otto_font_file .forceundef /subfilefilter { % <file> <length> subfilefilter <filter> % SubFileDecode interprets a length of 0 as infinite. dup 0 le { pop pop () 0 } if () /SubFileDecode filter -} bind def +} .internalbind def /advance { % <n> advance - f cff eq { pos add /pos exch store } { pop } ifelse -} bind def +} .internalbind def /next { % - next <byte> f read { 1 advance @@ -144,7 +144,7 @@ currentdict /.init_wOFF_otto_font_file .forceundef pdfformaterror } if } ifelse -} bind def +} .internalbind def /next2 { % - next2 <byte1> <byte2> f read { f read { @@ -155,7 +155,7 @@ currentdict /.init_wOFF_otto_font_file .forceundef CFFDEBUG { ( ) print dup = } if } ifelse } if -} bind def +} .internalbind def /nextstring { % <length> nextstring <string> dup 0 eq { pop () @@ -163,29 +163,29 @@ currentdict /.init_wOFF_otto_font_file .forceundef string f exch readstring pop dup length advance CFFDEBUG { ( ) print dup //== exec } if } ifelse -} bind def +} .internalbind def /card8 % - card8 <card8> /next load def /card16 { % - card16 <card16> next2 exch 8 bitshift add -} bind def +} .internalbind def /card32 { % - card32 <card32> card16 16 bitshift card16 add -} bind def +} .internalbind def /offsetprocs [ /card8 load /card16 load - { card8 16 bitshift card16 add } bind + { card8 16 bitshift card16 add } .internalbind /card32 load ] readonly def /offsetproc { % <offsize> offsetproc <proc> 1 sub //offsetprocs exch get -} bind def +} .internalbind def /offset { % <offsize> offset <offset> offsetproc exec -} bind def +} .internalbind def /sid % - <sid> sid /card16 load def @@ -201,7 +201,7 @@ def % ordinary CFF font. /StartData { % <resname> <nbytes> StartData - currentfile exch subfilefilter //false //false ReadData pop -} bind executeonly def +} .internalbind def /ReadData { % <resname> <file> <forceresname> <forcecid> ReadData <fontset> % Initialize. @@ -236,7 +236,7 @@ def end % FontSetInit ProcSet /FontSet defineresource -} bind executeonly def +} .internalbind def % ---------------- Resource category definition ---------------- % diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps index 197a0d3c5cf..34da79a6270 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cidcm.ps @@ -57,15 +57,15 @@ languagelevel 2 .setlanguagelevel currentglobal //true setglobal begin /begincmap {} def - /usecmap {pop} bind def + /usecmap {pop} .internalbind def - {stop} bind + {stop} .internalbind [ /begincodespacerange /endcodespacerange /beginnotdefchar /endnotdefchar /beginnotdefrange /endnotdefrange /begincidchar /endcidchar /begincidrange /endcidrange /endcmap /usefont /StartData ] { 1 index def - } bind forall + } .internalbind forall pop currentdict end def @@ -80,7 +80,7 @@ currentdict end def } { //findresource exec } ifelse -} bind def +} .internalbind def % Define procedures for pre-scanning : @@ -100,7 +100,7 @@ currentdict end def } repeat { begin } repeat -} bind def +} .internalbind def /PrescanFile { % - PrescanFile - { //.prs_dict /.prsFile get token { @@ -115,7 +115,7 @@ currentdict end def stop } ifelse } loop -} bind odef +} .internalbind odef /GetCIDSystemInfoFromFile { % <file> GetCIDSystemInfoFromFile <CSI> @@ -136,7 +136,7 @@ currentdict end def //.prs_dict /.prsResult get end RESMPDEBUG { (cidcm GetCIDSystemInfoFromFile end) = } if -} bind def +} .internalbind def /GetCIDSystemInfo { % <InstName> <CatName> GetCIDSystemInfo <CSI> @@ -197,7 +197,7 @@ currentdict end def } ifelse end RESMPDEBUG { (cidcm GetCIDSystemInfo end) = } if -} bind def +} .internalbind def /IsCompatibleCSI { % <CSI-M> <CSI-F> IsCompatibleCSI <bool> @@ -240,7 +240,7 @@ currentdict end def exch pop exch pop % bEQ exit } loop -} bind def +} .internalbind def /IsWellComposed { % <CIDFontName> <CMapName> IsWellComposed <bool> @@ -258,7 +258,7 @@ currentdict end def } { pop pop //false } ifelse -} bind def +} .internalbind def /IsComposedFont { % <FontName> IsComposedFont <CIDFontName> <CMapName> true % <FontName> IsComposedFont false @@ -294,7 +294,7 @@ currentdict end def } for pop } stopped -} bind def +} .internalbind def /ComposeName { % <CIDFont> <CMap> <scr> ComposeName <CIDFont-CMap> dup dup 5 2 roll % (scr) (scr) /CIDFont /CMap (scr) @@ -307,7 +307,7 @@ currentdict end def exch getinterval % (scr) /CMap l1 (scrT) 3 2 roll exch cvs length % (scr) l1 l2 add 0 exch getinterval % (CIDFont-CMap) -} bind def +} .internalbind def % Redefine the /Font category with CIDFont-CMap construction : @@ -327,7 +327,7 @@ currentdict end def //FindResource exec } ifelse } ifelse -} bind executeonly def +} .internalbind def /ResourceStatus { % <InstName> ResourceStatus <nStatus> <nSize> true % <InstName> ResourceStatus false @@ -359,7 +359,7 @@ currentdict end def //false } ifelse } ifelse -} bind executeonly def +} .internalbind def /ResourceForAll { % <template> <proc> <scratch> ResourceForAll - @@ -440,7 +440,7 @@ currentdict end def % Make the enumerator and apply it : /MappedCategoryRedefiner /ProcSet findresource /MakeResourceEnumerator get exec exec -} bind executeonly def +} .internalbind def currentdict end /Font exch /Category defineresource pop end diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps b/Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps index 1ebf7640886..f6bdaa16189 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_ciddc.ps @@ -37,7 +37,7 @@ currentglobal //true setglobal pop % /ResName currentdict end /Decoding % /ResName <<inst>> /Decoding defineresource pop -} bind +} .internalbind >> /ProcSet defineresource pop @@ -50,33 +50,33 @@ dup /InstanceType /dicttype put %----------------ParseCMap_Inverse procset---------------------------- /ParseCMap_Inverse << - /findresource { pop } bind - /defineresource { pop pop } bind + /findresource { pop } .internalbind + /defineresource { pop pop } .internalbind /dict {} - /def { pop pop } bind + /def { pop pop } .internalbind /dup //null - /begin { pop } bind + /begin { pop } .internalbind /end {} /currentdict //null /CMapName //null - /usecmap { pop } bind + /usecmap { pop } .internalbind /begincmap {} /endcmap {} - /begincodespacerange { pop mark } bind - /endcodespacerange { cleartomark } bind - /beginnotdefrange { pop mark } bind - /endnotdefrange { cleartomark } bind - /beginbfchar { pop mark } bind - /endbfchar { pop mark } bind + /begincodespacerange { pop mark } .internalbind + /endcodespacerange { cleartomark } .internalbind + /beginnotdefrange { pop mark } .internalbind + /endnotdefrange { cleartomark } .internalbind + /beginbfchar { pop mark } .internalbind + /endbfchar { pop mark } .internalbind /beginbfrange { begincidrange } /endbfrange { endcidrange } /begincidchar { beginbfchar } /endcidchar { endbfchar } - /begincidrange { pop mark } bind - /endcidrange { cleartomark } bind + /begincidrange { pop mark } .internalbind + /endcidrange { cleartomark } .internalbind >> % Just keep it on stack for a while. -% Now we define another dict for local binding, than merge it with the previous one : +% Now we define another dict for local .internalbinding, than merge it with the previous one : dup length 5 add dict begin /.Ranges 40 dict def % Key = CID/256, value = array of 256 integer codes. @@ -84,7 +84,7 @@ dup length 5 add dict begin /.StringToInt % <string> .StringToInt <integer> { 0 exch { exch 8 bitshift add } forall - } bind def + } .internalbind def /.SetCouple % <I> <b> .SetCouple - { exch % b I @@ -111,7 +111,7 @@ dup length 5 add dict begin } { pop 3 2 roll put % } ifelse - } bind def + } .internalbind def /endcidrange { % Writes the inversed CMap to .Ranges @@ -131,13 +131,13 @@ dup length 5 add dict begin pop } repeat pop % mark - } bind def + } .internalbind def /.GetCIDDecoding % - .GetCIDDEcoding <dict> { //.Ranges dup length dict copy //.Ranges //.PurgeDict exec //.Ranges /CIDCount 0 put - } bind def + } .internalbind def currentdict end exch copy % Merge the dicts - see above. @@ -204,7 +204,7 @@ begin exch pop begin % .GetCIDDecoding end - } bind executeonly def + } .internalbind def /FindResource % <name> FindResource <dict> { currentglobal exch % bGlobal /InstName @@ -212,7 +212,7 @@ begin dup //.MakeInstance exec % bGlobal /InstName <Inst> DefineResource % bGlobal <Inst> exch setglobal % <Inst> - } bind executeonly def + } .internalbind def currentdict end /CIDDecoding exch /Category defineresource pop diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps index 2cc2ecd8e9a..24c7684e3c3 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cidfm.ps @@ -26,7 +26,7 @@ languagelevel 2 .setlanguagelevel { % Only for client's needs. dup type /stringtype eq exch dup type /nametype eq 3 -1 roll or -} bind def +} .internalbind def /RecordVirtualMethods 3 dict begin @@ -42,7 +42,7 @@ languagelevel 2 .setlanguagelevel dup length dict copy % /Name <<CIDFont>> 1 index ResourceStatus pop exch pop % /Name <<CIDFont>> size - } bind def + } .internalbind def /GetFilePath % <scratch> <Name> <record> GetFilePath <filepath> { % We know that currentdict is the category. @@ -51,7 +51,7 @@ languagelevel 2 .setlanguagelevel { exch ResourceFileName } if - } bind def + } .internalbind def /GetSize % <Name> <record> GetSize <size> { % We know that currentdict is the category. @@ -69,7 +69,7 @@ languagelevel 2 .setlanguagelevel /undefinedresource signalerror } ifelse }ifelse - } bind def + } .internalbind def /GetCSI % <record> GetCSI null % <record> GetCSI dict @@ -87,11 +87,11 @@ languagelevel 2 .setlanguagelevel GetCIDSystemInfoFromMap } ifelse RESMPDEBUG { (cidfm GetCSI end ) print dup = } if - } bind def + } .internalbind def /IsActive % <record> IsActive <bool> { pop //true - } bind def + } .internalbind def currentdict end def @@ -142,7 +142,7 @@ currentdict end def /.splitdirname { (/) rsearch { //true } { (\\) rsearch } ifelse {exch concatstrings exch pop //true}{//false} ifelse -} bind def +} .internalbind def % <file> .addcidfmappath - /.addcidfmpermitpath @@ -152,7 +152,7 @@ currentdict end def //.splitdirname exec {dup def} if } if -} bind def +} .internalbind def /VerifyMap % <raw_map> VerifyMap - { @@ -256,7 +256,7 @@ currentdict end def } loop } loop pop pop -} bind def +} .internalbind def currentdict /.splitdirname undef currentdict /.addcidfmpermitpath undef @@ -273,7 +273,7 @@ currentdict /.addcidfmpermitpath undef } { //false } ifelse -} bind def +} .internalbind def currentdict end diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps index 5c5c706aec2..b4153c146d0 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cidfn.ps @@ -29,7 +29,7 @@ } { 1 index /FontType 3 -1 roll put //true } ifelse -} bind def +} .internalbind def /.cidfonttypes where { pop } { /.cidfonttypes 6 dict def } ifelse .cidfonttypes @@ -45,7 +45,7 @@ dup length string copy exch setglobal } ifelse -} bind def +} .internalbind def % The key in .cidfonttypes is the CIDFontType value; % the value is a procedure that takes a font name and the CIDFont dictionary @@ -112,7 +112,7 @@ dup 0 { } ifelse } forall 3 -1 roll setglobal -} bind def +} .internalbind def % Read some Subrs for the current Type 1 subfont. % The subfont's Private dict is currentdict; the CIDFont itself is the @@ -123,7 +123,7 @@ dup 0 { dup SDBytes .readint exch SDBytes add SDBytes .readint 1 index sub string ReadString 2 index 3 1 roll put } for -} bind def +} .internalbind def % Ensure that all the Subrs for the current Type 1 subfont are loaded. % The subfont's Private dict is currentdict; the CIDFont itself is the @@ -145,7 +145,7 @@ dup 0 { } ifelse Subrs copy pop } if -} bind def +} .internalbind def % ------ CIDFontType 1 (FontType 10) ------ % @@ -230,7 +230,7 @@ pop % .cidfonttypes CIDFontName currentdict /CIDFont defineresource pop end % CID font dict end % resource category dict -} bind def +} .internalbind def % Some Adobe fonts include the line % /Setup /cid_Setup load def @@ -252,7 +252,7 @@ pop % .cidfonttypes % Read from a string or an array of strings. GlyphData .stringsreadstring } ifelse -} bind def +} .internalbind def /.stringsreadstring % <pos> <string> <strings> .stringsreadstring % <vmstring> { dup type /stringtype eq @@ -282,17 +282,17 @@ pop % .cidfonttypes ifelse } ifelse -} bind def +} .internalbind def % Interpret a byte string as a (big-endian) integer. /.cvbsi % <bytes> .cvbsi <int> { 0 exch { exch 8 bitshift add } forall -} bind def +} .internalbind def % Read an integer from binary data. /.readint % <pos> <nbytes> .readint <int> { string ReadString .cvbsi -} bind def +} .internalbind def currentdict end @@ -303,7 +303,7 @@ currentdict end /.readglyphdata { currentfont exch .type9mapcid FDArray exch get exch -} bind executeonly def +} .internalbind executeonly def % BuildGlyph procedure for CIDFontType 0. % The name %Type9BuildGlyph is known to the interpreter. @@ -323,7 +323,7 @@ currentdict end } ifelse %**** WRONG **** end .setglobal -} bind executeonly def +} .internalbind executeonly def % ------ CIDFontType 2 ------ % @@ -336,7 +336,7 @@ currentdict end } if % Stack: cidfont cid glyphindex 1 index exch .type42execchar -} bind executeonly def +} .internalbind executeonly def % ---------------- Define resources ---------------- % @@ -367,7 +367,7 @@ languagelevel exch 2 .setlanguagelevel /ProvideUnicodeDecoding get exec } if dup /CIDFontType get //.cidfonttypes exch get exec -} bind executeonly odef +} .internalbind executeonly odef /CIDFont /Generic /Category findresource dup length dict .copydict dup /InstanceType /dicttype put @@ -389,14 +389,14 @@ dup /DefineResource { } { dup /undefinedresource signalerror } ifelse -} bind def +} .internalbind def dup /.LoadResource { currentglobal { //.loadcidfontresource exec } { //true setglobal {//.loadcidfontresource exec} stopped //false setglobal {stop} if } ifelse -} bind put +} .internalbind put /Category defineresource pop @@ -425,7 +425,7 @@ dup /.CheckResource { //false } ifelse } ifelse -} bind put +} .internalbind put /Category defineresource pop .setlanguagelevel diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps index d7135e50a0e..455291b7b9d 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cidtt.ps @@ -52,14 +52,14 @@ currentdict /super.complete_instance currentdict /complete_instance get put % Now fill it : Decoding TT_cmap SubstNWP GDBytes CIDMap .fillCIDMap currentdict end -} bind def +} .internalbind def /GenerateIdentityCIDMap % <font> GenerateCIDMap <font> { begin /CIDMap [ 44000 string 44000 string 44000 string] def CIDMap .fillIdentityCIDMap currentdict end -} bind def +} .internalbind def /load_sfnts % <FontDict> load_sfnts <FontDict> { % Read the True Type file from the path /Path, and buld /sfnts, @@ -104,7 +104,7 @@ currentdict /super.complete_instance currentdict /complete_instance get put //ChooseDecoding exec % <font> //GenerateCIDMap exec % <font> } ifelse -} bind def +} .internalbind def %-----------TrueType-specific methods for category redefinition : ----------- @@ -129,14 +129,14 @@ currentdict /super.complete_instance currentdict /complete_instance get put } ifelse } ifelse end -} bind def +} .internalbind def /complete_instance % <font_name> <FontDict> <Options> complete_FAPI_Font <font_name> <FontDict> { 1 index /CIDFontType 2 put % Other types are not emulated yet. //super.complete_instance exec //RefinePath exec //load_sfnts exec -} bind def +} .internalbind def /ValidFileTypes << @@ -147,13 +147,13 @@ currentdict /super.complete_instance currentdict /complete_instance get put /IsMyRecord % <raw_record> -> <raw_record> bool { dup type /dicttype eq { dup /FileType .knownget { //ValidFileTypes exch known } { //false } ifelse } { //false } ifelse -} bind def +} .internalbind def currentdict /ValidFileTypes undef /IsActive % <record> IsActive <bool> { pop //true -} bind def +} .internalbind def /CIDFontRecordVirtualMethods //RecordVirtualMethodsStub dup length 3 add dict copy begin /GetCSI //TranslateCSI def @@ -163,20 +163,20 @@ currentdict /ValidFileTypes undef //CIDFontOptions //complete_instance exec 2 copy //GetSize exec 4 3 roll setglobal - } bind def + } .internalbind def currentdict end def % Redefine the /CIDFont category : 4 dict begin /CategoryName /CIDFont def /IsMapFileOptional //true def - /VerifyMap { pop } bind def + /VerifyMap { pop } .internalbind def /PreprocessRecord % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool> { //IsMyRecord exec dup { pop dup /RecordVirtualMethods //CIDFontRecordVirtualMethods put //true } if - } bind def + } .internalbind def currentdict end /MappedCategoryRedefiner /ProcSet findresource /Redefine get exec diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps index 0e1c6fc1466..71220234ca9 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cmap.ps @@ -44,7 +44,7 @@ } if pop CMAPDEBUG { (...FINISHED...\n) print } if -} bind def +} .internalbind def /.composefontdict { % <name> <cmap|cmapname> <fonts> composefont <name> <font_dict> 10 dict begin @@ -74,13 +74,13 @@ CMap /WMode .knownget { /WMode exch def } if /FontType 0 def pop pop currentdict end -} bind executeonly odef +} .internalbind odef % composefont doesn't appear in CMap files -- it's documented in % the "PostScript Language Reference Manual Supplement". /composefont { % <name> <cmap|cmapname> <fonts> composefont <font> .composefontdict /Font defineresource -} bind def +} .internalbind def % ---------------- CMap operators ---------------- % @@ -115,7 +115,7 @@ /.FontIndex 0 def /.TempMaps [20 dict 50 dict 50 dict] def /CodeMap //null def % for .buildcmap -} bind def +} .internalbind def /endcmap { % - endcmap - //.rewriteTempMapsNotDef exec @@ -154,7 +154,7 @@ currentdict /.TempMaps undef /FontMatrices FontMatrices .endmap def -} bind def +} .internalbind def /.endmap { % <map> .endmap <map> dup type /arraytype eq { @@ -168,31 +168,31 @@ } { dup type /stringtype eq { readonly } if } ifelse -} bind def +} .internalbind def /.appendmap { % -mark- <elt> ... <array#> .appendmap - .TempMaps exch get counttomark 1 add 1 roll ] 1 index length exch put -} bind def +} .internalbind def /begincodespacerange { % <count> begincodespacerange - pop mark -} bind def +} .internalbind def /endcodespacerange { % <code_lo> <code_hi> ... endcodespacerange - 0 .appendmap -} bind def +} .internalbind def /usecmap { % <CMap_name> usecmap - /CMap findresource dup % Copy the top level of .CodeMapData /.CodeMapData exch /.CodeMapData get copyarray def /FontMatrices exch /FontMatrices get copyarray def -} bind def +} .internalbind def /usefont { % <fontID> usefont - /.FontIndex exch def -} bind def +} .internalbind def /beginusematrix { % <fontID> beginusematrix - FontMatrices wcheck not FontMatrices length 2 index le or { @@ -200,11 +200,11 @@ dup 0 FontMatrices putinterval /FontMatrices exch def } if -} bind def +} .internalbind def /endusematrix { % <matrix> endusematrix - FontMatrices 3 1 roll put -} bind def +} .internalbind def % ------ Rearranged font operators ------ % @@ -213,17 +213,17 @@ /.FontNames exch def /.FontName exch def begincmap -} bind def +} .internalbind def /endrearrangedfont { % - endrearrangedfont - (REARRANGED FONTS NOT IMPLEMENTED YET.) = flush .FontName .FontNames 0 get findfont end definefont pop -} bind def +} .internalbind def % ------ Character name/code selector operators ------ % /beginbfchar { % <count> beginbfchar - pop mark -} bind def +} .internalbind def /endbfchar { % [ <code> <to_code|charname> ... endbfchar ] [ //true % [<da><ta>] [ true 3 -1 roll % [ true [<da><ta>] @@ -237,11 +237,11 @@ } forall pop 1 .appendmap -} bind def +} .internalbind def /beginbfrange { % <count> beginbfrange - pop mark -} bind def +} .internalbind def /endbfrange { % <code_lo> <code_hi> <to_code|(charname*)> ... % endbfrange - ] [ 0 % [<da><ta><set>] [ 0 @@ -273,12 +273,12 @@ } forall pop 1 .appendmap -} bind def +} .internalbind def /.addbfchar { % <code> <to_code|charname> .addbfchar % <prefix> <params> <key> <value> <font_index> 1 index exch .addbfrange -} bind def +} .internalbind def /.addbfrange { % <code_lo> <code_hi> <to_code|charname> % .addbfrange <<same as .addbfchar>> 4 string dup 3 @@ -304,23 +304,23 @@ 3 -1 roll } ifelse .FontIndex -} bind def +} .internalbind def % ------ CID selector operators ------ % /begincidchar { % <count> begincidchar - pop mark -} bind def +} .internalbind def /endcidchar { % <code> <cid> ... endcidchar - 1 .endmapchars -} bind def +} .internalbind def /begincidrange { % <count> begincidrange - pop mark -} bind def +} .internalbind def /endcidrange { % <code_lo> <code_hi> <cid_base> ... endcidrange - 1 .endmapranges -} bind def +} .internalbind def /.endmapchars { % -mark- <code> <cid> ... <map#> .endmapchars - counttomark 1 add 1 roll @@ -390,7 +390,7 @@ } if } repeat counttomark 2 add -1 roll .appendmap -} bind def +} .internalbind def /.endmapranges { % -mark- <code_lo> <code_hi> <cid_base> ... <map#> % .endmapranges - @@ -496,29 +496,29 @@ } if % end of 2 (or more) ranges } repeat counttomark 2 add -1 roll .appendmap -} bind def +} .internalbind def /.endmapvalue { % <cid> .endmapvalue (hi,lo) .FontIndex 2 string dup 0 3 index -8 bitshift put % value dup 1 4 -1 roll 255 and put .FontIndex % font_index -} bind def +} .internalbind def % ------ notdef operators ------ % /beginnotdefchar { % <count> beginnotdefchar - pop mark -} bind def +} .internalbind def /endnotdefchar { % <code> <cid> ... endnotdefchar - 2 .endmapchars -} bind def +} .internalbind def /beginnotdefrange { % <count> beginnotdefrange - pop mark -} bind def +} .internalbind def /endnotdefrange { % <code_lo> <code_hi> <cid> ... endnotdefrange - 2 .endmapranges -} bind def +} .internalbind def % ---------------- Resource category definition ---------------- % @@ -553,7 +553,7 @@ dup /DefineResource { } if dup /CodeMap .knownget { //null eq { .buildcmap } if } if /Generic /Category findresource /DefineResource get exec -} bind executeonly put +} .internalbind put /Category defineresource pop % We might have loaded CID font support already. /CIDInit /ProcSet 2 copy { findresource } //.internalstopped exec diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps b/Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps index 8d38a2eb6ce..e0b25d07a98 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_cspace.ps @@ -105,7 +105,7 @@ end % colorspacedict } stopped {cleartomark}if } ifelse -}bind def +}.internalbind def end diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps b/Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps index 383b91d74bc..81ce1e36a60 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_diskn.ps @@ -53,7 +53,7 @@ systemdict begin exch .setglobal } executeonly if -} .bind executeonly odef % must be bound and hidden for .forceput +} .forcebind odef % must be bound and hidden for .forceput % Modify .putdevparams to force regeneration of .searchabledevs list /.putdevparams { @@ -61,7 +61,7 @@ systemdict begin % doesn't get run enough to justify the complication //.putdevparams //systemdict /.searchabledevs .forceundef -} .bind executeonly odef % must be bound and hidden for .forceundef +} .forcebind odef % must be bound and hidden for .forceundef % ------ extend filenameforall to handle wildcards in %dev% part of pattern -------% /filenameforall { @@ -144,7 +144,7 @@ systemdict begin //file } if -} bind odef +} .internalbind odef % redefine deletefile to search all devices in order /deletefile { @@ -158,7 +158,7 @@ systemdict begin } forall not { $error /errorname get /deletefile .systemvar exch signalerror } if -} bind odef +} .internalbind odef % redefine status to search all devices in order /status { @@ -180,7 +180,7 @@ systemdict begin //status } ifelse -} bind odef +} .internalbind odef % Also redefine renamefile to search all devices in order /renamefile { @@ -198,7 +198,7 @@ systemdict begin not { $error /errorname get /renamefile .systemvar exch signalerror } if 3 -1 roll concatstrings exch //renamefile -} bind odef +} .internalbind odef % redefine devforall to process devices in numeric order % Spec's for 'devforall' are unclear, but font downloaders may expect this diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps index e65b4de263b..015e04847db 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_dps1.ps @@ -21,7 +21,7 @@ level2dict begin % ------ Virtual memory ------ % /currentshared /.currentglobal load def -/scheck {.gcheck} bind odef +/scheck {.gcheck} .internalbind odef %****** FOLLOWING IS WRONG ****** /shareddict currentdict /globaldict .knownget not { 20 dict } if def @@ -58,7 +58,7 @@ level2dict begin { //SharedFontDirectory } { /LocalFontDirectory .systemvar } % can't embed ref to local VM ifelse .forceput pop % LocalFontDirectory is local, systemdict is global - } .bind executeonly odef + } .forcebind odef % Don't just copy (load) the definition of .setglobal: % it gets redefined for LL3. /setshared { /.setglobal .systemvar exec } odef @@ -95,7 +95,7 @@ level2dict begin if } ifelse pop - } .bind odef + } .forcebind odef % If we load a font into global VM within an inner save, the restore % will delete it from FontDirectory but not from SharedFontDirectory. @@ -136,6 +136,6 @@ level2dict begin //SharedFontDirectory exch .forcecopynew pop .currentglobal .setglobal % Rebind FontDirectory according to current VM. pop - } .bind odef + } .forcebind odef end % level2dict diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps index 4b54f2fba5e..4c48634fa6b 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_dps2.ps @@ -28,7 +28,7 @@ level2dict begin /.makestackdict { { counttomark -1 roll } forall .dicttomark - } bind def + } .internalbind def /currenthalftone % - currenthalftone <dict> { mark .currenthalftone { { exch pop } % halftone @@ -63,7 +63,7 @@ currentdict /.makestackdict undef counttomark 2 roll } forall pop pop /Default 1 index .dicttomark exch pop { .sethalftone5 } -} bind def +} .internalbind def % The value of each entry in .halftonetypes is a procedure: % <setdict> <htdict> <<proc>> <setdict'> <htdict'> <sethalftoneproc> @@ -74,7 +74,7 @@ systemdict begin 15 dict /.halftonetypes 1 index def begin 1 { mark exch /Default exch .dicttomark { .sethalftone5 } - } bind def + } .internalbind def 2 { 1 { /Frequency /Angle /SpotFunction } { /RedFrequency /RedAngle /RedSpotFunction @@ -82,10 +82,10 @@ systemdict begin /BlueFrequency /BlueAngle /BlueSpotFunction /GrayFrequency /GrayAngle /GraySpotFunction } //.makehalftoneRGBV exec - } bind def + } .internalbind def 3 { mark exch /Default exch .dicttomark { .sethalftone5 } - } bind def + } .internalbind def 4 { 3 { /Width /Height /Thresholds } { /RedWidth /RedHeight /RedThresholds @@ -93,7 +93,7 @@ systemdict begin /BlueWidth /BlueHeight /BlueThresholds /GrayWidth /GrayHeight /GrayThresholds } //.makehalftoneRGBV exec - } bind def + } .internalbind def 5 { pop dup length dict copy mark 1 index { @@ -114,7 +114,7 @@ systemdict begin pop } ifelse } forall .dicttomark { .sethalftone5 } - } bind def + } .internalbind def end end currentdict /.makehalftoneRGBV undef @@ -132,7 +132,7 @@ currentdict /.makehalftoneRGBV undef } if exec exec .setglobal pop -} .bind odef +} .forcebind odef % Redefine setscreen and setcolorscreen to recognize halftone dictionaries, % and to insert the Frequency and Angle into Type 1 halftones, per % Adobe TN 5085. @@ -145,19 +145,19 @@ currentdict /.makehalftoneRGBV undef languagelevel 3 ge { dup /AccurateScreens dup getuserparam put } if } if - } bind def + } .internalbind def /setscreen % <ignore*2> <dict> setscreen - { dup type /dicttype eq { //.fixsethalftonescreen exec sethalftone pop pop pop } { //setscreen } ifelse - } .bind odef + } .forcebind odef /setcolorscreen % <ignore*11> <dict> setcolorscreen - { dup type /dicttype eq { //.fixsethalftonescreen exec sethalftone 12 { pop } repeat } { //setcolorscreen } ifelse - } .bind odef + } .forcebind odef currentdict /.fixsethalftonescreen undef % Redefine currentscreen and currentcolorscreen to extract the Frequency @@ -167,7 +167,7 @@ currentdict /.fixsethalftonescreen undef { dup /Frequency get 1 index /Angle get } { 60.0 0.0 } % Adobe returns these as reals ifelse 3 2 roll - } bind def + } .internalbind def /currentscreen % - currentscreen 60 0 <dict> { .currenthalftone { { //.fixcurrenthalftonescreen exec }% halftone @@ -196,7 +196,7 @@ currentdict /.fixcurrenthalftonescreen undef /.UserObjects { .userdict /UserObjects -} bind executeonly odef +} .internalbind odef % In order to get proper error recovery behavior, we need to be careful % not to pop any operands from the stack until we're done. % The code below faithfully duplicates the apparent array-growing @@ -220,21 +220,21 @@ currentdict /.fixcurrenthalftonescreen undef .UserObjects 3 .argindex 1 add 10 .max .localvmarray put } ifelse .UserObjects get 2 .argindex 2 index put pop pop -} .bind odef +} .forcebind odef /execuserobject { % <index> execuserobject - dup type /integertype ne { % Adobe validates the argument before accessing UserObjects - CET 31-03 /execuserobject .systemvar /typecheck signalerror } if .UserObjects get 1 .argindex get exch pop exec -} .bind odef +} .forcebind odef /undefineuserobject { % <index> undefineuserobject - dup type /integertype ne { % Adobe validates the argument before accessing UserObjects - CET 31-11 /undefineuserobject .systemvar /typecheck signalerror } if .UserObjects get 1 .argindex //null put pop -} .bind odef +} .forcebind odef currentdict /.UserObjects undef % ------ Cache control ------ % diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps index f2c66d912d2..5ad9dd91692 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_dscp.ps @@ -21,18 +21,18 @@ dup 0 ge { << /Orientation 2 index >> setpagedevice } if pop -} bind def +} .internalbind def % This dictionary contains local handlers for DSC comments. % See header in zdscpars.c for more information. % <dsc_dict> handler <dsc_dict> /DSCparseprocs mark - /Orientation { dup /Orientation get send_orientation } bind + /Orientation { dup /Orientation get send_orientation } .internalbind /PageOrientation { dup /PageOrientation .knownget { send_orientation } { dup /Orientation .knownget { send_orientation } if } - ifelse } bind - /Page { dup /Orientation .knownget { send_orientation } if } bind - /NOP { } bind + ifelse } .internalbind + /Page { dup /Orientation .knownget { send_orientation } if } .internalbind + /NOP { } .internalbind .dicttomark readonly def % This procedure is called whenever a DSC comment is found by the interpreter @@ -54,7 +54,7 @@ } if } if pop pop % remove file, dict -} bind def +} .internalbind def % Check whether the currently installed parser is the one defined in this file. /.using_parse_dsc { % - .using_parse_dsc <proc> <using?> @@ -65,9 +65,9 @@ } { //false } ifelse -} bind def +} .internalbind def -% Establish a binding for dsc_dict. +% Establish a .internalbinding for dsc_dict. userdict /dsc_dict //null put % - dsc_init - @@ -88,13 +88,13 @@ userdict /dsc_dict //null put } ifelse setglobal /do_parse_dsc //true def -} bind def +} .internalbind def % Enable the DSC parser defined in this file. % - enable_dsc - /enable_dsc { dsc_init -} bind def +} .internalbind def % Disable the DSC parser defined in this file. % - disable_dsc - @@ -112,4 +112,4 @@ userdict /dsc_dict //null put } ifelse % If we couldn't restore the old parser, at least disable ours. /do_parse_dsc //false def -} bind def +} .internalbind def diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps b/Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps index fbfe1107dad..01139a1017a 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_epsf.ps @@ -32,7 +32,7 @@ /EPSBoundingBoxString () def % set if either BoundingBox is seen (even if invalid) /EPSBoundingBoxSetState { //systemdict /EPSBoundingBoxState 3 -1 roll .forceput -} .bind executeonly odef % .forceput must be bound and hidden +} .forcebind odef % .forceput must be bound and hidden % Parse 4 numbers for a bounding box /EPSBoundingBoxParse { % (llx lly urx ury) -- llx lly urx ury true OR false @@ -45,7 +45,7 @@ } { cleartomark //false } ifelse -} bind executeonly odef +} .internalbind odef % Crop the page to the BoundingBox /EPSBoundingBoxCrop { % llx lly urx ury -- @@ -55,7 +55,7 @@ exch 3 index sub exch 2 index sub % stack: llx lly urx-llx ury-lly << /PageSize [ 5 -2 roll ] >> setpagedevice neg exch neg exch translate -} bind executeonly odef +} .internalbind odef % Rescale, translate and rotate to fit the BoundingBox on the page /EPSBoundingBoxFitPage { % llx lly urx ury -- @@ -113,7 +113,7 @@ % Center the document neg exch neg exch translate -} bind executeonly odef +} .internalbind odef /EPSBoundingBoxProcess { % (llx lly urx ury) state -- % The following 'lt' check prioritzies HiResBoundingBox over BoundingBox @@ -160,7 +160,7 @@ } { pop pop } ifelse -} bind executeonly odef +} .internalbind odef % Perform anchorsearch on the strings in the array until a match is found. /anchorsearchforany { % haystack [needle1 ...] --> post needle true @@ -180,7 +180,7 @@ } ifelse } forall exch % haystack false | post needle true -} bind def +} .internalbind def /ProcessEPSComment { % file comment -- file comment /EPSBoundingBoxState .systemvar 3 lt { @@ -254,7 +254,7 @@ } ifelse } ifelse } if -} bind executeonly def +} .internalbind def % Install EPS handler for DSC comments, which we do later /EPSBoundingBoxInit { @@ -266,7 +266,7 @@ 4 array astore cvx readonly << /ProcessDSCComment 3 -1 roll >> setuserparams } if -} bind executeonly odef +} .internalbind odef /.runNoEPS /run load def @@ -284,7 +284,7 @@ count runEPS_op_count sub {pop} repeat countdictstack runEPS_dict_count sub {end} repeat runEPS_save restore -} bind executeonly odef +} .internalbind odef /run { % file OR string -- dup type /filetype ne { (r) file } if @@ -319,7 +319,7 @@ pop cvx //.runNoEPS } ifelse -} bind odef +} .internalbind odef % Handle DOS EPS files. @@ -359,7 +359,7 @@ userdict begin /.runstdin { { (%stdin) run } execute0 -} bind def +} .internalbind def end % undefine things defined in this file and not referenced elsewhere diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps b/Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps index 73d2fe8b751..b13462255b7 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_fapi.ps @@ -51,7 +51,7 @@ languagelevel 2 .setlanguagelevel % dup mark eq { % pop //true % } if -} bind def +} .internalbind def %----------------------------- Process FAPIconfig ----------------------- @@ -170,20 +170,20 @@ currentdict /super.complete_instance currentdict /complete_instance get put } if def currentdict end -} bind def +} .internalbind def /complete_instance % <font_name> <FontDict> <Options> complete_FAPI_Font <font_name> <FontDict> { //super.complete_instance exec dup /CIDFontName known { /CIDFontPath } { /FontPath } ifelse //RefinePath exec -} bind def +} .internalbind def /IsMyRecord % <raw_record> -> <raw_record> bool { dup type /dicttype eq { dup /FAPI known } { //false } ifelse -} bind def +} .internalbind def /IsActive % <record> IsActive <bool> { pop //is_device_compatible_to_FAPI exec -} bind def +} .internalbind def /FontRecordVirtualMethods //RecordVirtualMethodsStub dup length 2 add dict copy begin /IsActive //IsActive def @@ -192,7 +192,7 @@ currentdict /super.complete_instance currentdict /complete_instance get put //FontOptions //complete_instance exec 2 copy //GetSize exec 4 3 roll setglobal - } bind def + } .internalbind def currentdict end def /CIDFontRecordVirtualMethods //RecordVirtualMethodsStub dup length 3 add dict copy begin @@ -203,7 +203,7 @@ currentdict end def //CIDFontOptions //complete_instance exec 2 copy //GetSize exec 4 3 roll setglobal - } bind def + } .internalbind def currentdict end def /ReadFCOfontmap: % <path> ReadFCOfontmap: name dict ... @@ -283,7 +283,7 @@ currentdict end def } ifelse } loop currentdict /fontfile undef -} bind def +} .internalbind def %----------------------------------The Redefintion--------------------- @@ -293,26 +293,26 @@ currentdict end def 4 dict begin /CategoryName /Font def /MapFileName systemdict /FAPIfontmap known {/FAPIfontmap .systemvar} {(FAPIfontmap)} ifelse def - /VerifyMap { pop } bind def + /VerifyMap { pop } .internalbind def /PreprocessRecord % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool> { //IsMyRecord exec dup { pop dup /RecordVirtualMethods //FontRecordVirtualMethods put //true } if - } bind def + } .internalbind def currentdict end Redefine % Redefine the /CIDFont category : 4 dict begin /CategoryName /CIDFont def /MapFileName systemdict /FAPIcidfmap known {/FAPIcidfmap .systemvar} {(FAPIcidfmap)} ifelse def - /VerifyMap { pop } bind def + /VerifyMap { pop } .internalbind def /PreprocessRecord % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool> { //IsMyRecord exec dup { pop dup /RecordVirtualMethods //CIDFontRecordVirtualMethods put //true } if - } bind def + } .internalbind def currentdict end Redefine %==================== A hook for buildfont* operators ==================== @@ -365,7 +365,7 @@ bind def { % checks whether execution stack contains packedarray started with /FAPI_hook_disable . /FAPI_hook_disable /MappedCategoryRedefiner /ProcSet findresource /execstack_lookup get exec //null ne -} bind def +} .internalbind def /FAPIhook_aux % <string|name> <font_dict> .FAPIhook <string|name> <font> { % name <<font>> @@ -416,7 +416,7 @@ bind def % Remove the plugin request from the font dictionary dup /FAPIPlugInReq undef } ifelse -} bind def +} .internalbind def /FAPIhook % <string|name> <font_dict> .FAPIhook <string|name> <font> { //is_device_compatible_to_FAPI exec @@ -424,33 +424,33 @@ bind def } { { (FAPIhook is disabled for the current device.\n) print flush } //FAPI_hook_debug exec } ifelse -} bind def +} .internalbind def % ------------------ Redefine .buildfont* with FAPI : ----------------------- /.buildfont1 { //.buildfont1 exec //FAPIhook exec -} bind % 'odef' is below. +} .internalbind % 'odef' is below. /.buildfont2 { //.buildfont2 exec //FAPIhook exec -} bind % 'odef' is below. +} .internalbind % 'odef' is below. /.buildfont42 { //.buildfont42 exec //FAPIhook exec -} bind % 'odef' is below. +} .internalbind % 'odef' is below. /.buildfont9 { //.buildfont9 exec //FAPIhook exec -} bind % 'odef' is below. +} .internalbind % 'odef' is below. /.buildfont10 { //.buildfont10 exec //FAPIhook exec -} bind % 'odef' is below. +} .internalbind % 'odef' is below. /.buildfont11 { //.buildfont11 exec //FAPIhook exec -} bind % 'odef' is below. +} .internalbind % 'odef' is below. end % the temporary dictionary for local binding. odef odef odef odef odef odef diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps b/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps index a10a63d534a..aa8e8dcb406 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps @@ -53,7 +53,7 @@ systemdict exch /.xlatmap exch put /Encoding findresource } if /Encoding exch def -} bind def +} .internalbind def /FontOptions 5 dict begin /make_procs currentdict def @@ -70,7 +70,7 @@ systemdict exch /.xlatmap exch put % See gs_fapi.ps currentdict /CharStrings known not {/CharStrings << /.notdef () >> def} if //FontCommon exec - } bind def + } .internalbind def 42 { /FontMatrix [1 0 0 1 0 0] def @@ -79,7 +79,7 @@ systemdict exch /.xlatmap exch put /sfnts [<00010000 0000 0000 0000 0000 0000>] def /GlyphDirectory [] def //FontCommon exec - } bind def + } .internalbind def %fixme : more font types. @@ -103,14 +103,14 @@ currentdict end def } ifelse end RESMPDEBUG { (fntem TranslateCSI end ) = } if -} bind def +} .internalbind def /CIDFontCommon { /CIDSystemInfo currentdict //TranslateCSI exec def currentdict /CSI undef /FontBBox [-128 -128 1024 1024] def % zfapi.ps refines it. /CIDCount 1 def % ChooseDecoding will set a reasonable value. -} bind def +} .internalbind def % GFlyph substitution table for narrow, wide, proportional glyphs - % used with TrueTypes. @@ -204,13 +204,13 @@ setpacking /GlyphDirectory [] def /GDBytes 1 def /FDBytes 0 def - } bind def + } .internalbind def 1 { //CIDFontCommon exec /FontMatrix [1 0 0 1 0 0] def /BuildGlyph {} def - } bind def + } .internalbind def 2 { //CIDFontCommon exec @@ -220,7 +220,7 @@ setpacking /sfnts [<00010000 0000 0000 0000 0000 0000>] def /Encoding [] def /CharStrings << /.notdef 0 >> def - } bind def + } .internalbind def currentdict end def @@ -239,7 +239,7 @@ currentdict end def setglobal currentdict end end -} bind def +} .internalbind def /GetFilePath % <scratch> <Name> <record> GetFilePath <filepath> { exch pop % (scratch) <record> @@ -248,12 +248,12 @@ currentdict end def % What we make here it is not a complete PS resource. % Unable to provide full conformity : % the attempt to run this file may fail. -} bind def +} .internalbind def /GetSize % <Name> <record> GetSize <size> { pop pop -1 % Unknown size. % fixme: probably we could provide an estimation size for some fonts. -} bind def +} .internalbind def /RecordVirtualMethodsStub 3 dict begin /GetFilePath //GetFilePath def @@ -336,7 +336,7 @@ currentdict end def } if 1 index exch /SubstNWP exch put } if -} bind def +} .internalbind def /PrintFontRef % <string|name> <font> PrintFontRef <string|name> <font> { dup /FontName known { (Font ) } { (CIDFont ) } ifelse print @@ -350,7 +350,7 @@ currentdict end def } { pop } ifelse -} bind def +} .internalbind def /GetFontType % <font> GetFontType int { dup /CIDFontType .knownget { @@ -358,7 +358,7 @@ currentdict end def } { /FontType get } ifelse -} bind def +} .internalbind def /FindInArray % <array> <elem> .array_find <bool> { //false 3 1 roll @@ -368,7 +368,7 @@ currentdict end def } if } forall pop -} bind def +} .internalbind def /ProvideUnicodeDecoding % <font> ProvideUnicodeDecoding <font> { @@ -411,7 +411,7 @@ currentdict end def exit } executeonly loop exch setglobal -} .bind executeonly odef % must be bound and hidden for .forceput +} .forcebind odef % must be bound and hidden for .forceput currentdict end /ProcSet defineresource pop diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps b/Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps index 60782724c7b..5b46ef1f558 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_fonts.ps @@ -34,7 +34,7 @@ ifelse 4 dict begin (<<) cvn /mark load def (>>) cvn /.dicttomark load def -/; { 2 index 3 1 roll .growput } bind def +/; { 2 index 3 1 roll .growput }.internalbind def %% Replace 0 (Fontmap) end def .setlanguagelevel @@ -54,7 +54,7 @@ end def % Define a reliable way of accessing FontDirectory in systemdict. /.FontDirectory { /FontDirectory .systemvar -} .bind executeonly odef +} .forcebind odef % Define a temporary string for local use, since using =string % interferes with some PostScript programs. @@ -67,13 +67,13 @@ end def exch pop exch } loop - } bind def + }.internalbind def % <dir.../base.extn> .basename <dir> /.splitdirname { (/) rsearch { //true } { (\\) rsearch } ifelse {exch concatstrings exch pop //true}{//false} ifelse -} bind def +}.internalbind def % <dict> .addfontmappermitpaths % As fontmap can contain a *lot* of individual entries @@ -94,7 +94,7 @@ end def } forall currentdict end {exch pop /PermitFileReading exch .addcontrolpath}forall -} bind def +}.internalbind def defaultfontmap_content length 0 gt {defaultfontmap_content .addfontmappermitpaths} if @@ -110,7 +110,7 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put 50 dict exch .readFontmap dup //.addfontmappermitpaths exec { .definefontmap } forall -} bind def +}.internalbind def /.readFontmap { % <dict> <file> .readFontmap <dict> { dup token not { closefile exit } if % stack: dict file fontname @@ -159,7 +159,7 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put } loop } ifelse } loop -} bind def +}.internalbind def % Add an entry in Fontmap. We redefine this if the Level 2 % resource machinery is loaded. /.definefontmapaux % <bool> <fontname> <file|alias> .definefontmapaux - @@ -207,17 +207,17 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put mark 4 -1 roll ] readonly .growput } ifelse .setglobal - } bind def + }.internalbind def /.definefontmap % <fontname> <file|alias> .definefontmap - { //false 3 1 roll //.definefontmapaux exec -} bind def +}.internalbind def /.definenativefontmap % <fontname> <file|alias> .definenativefontmap - { //true 3 1 roll //.definefontmapaux exec -} bind def +}.internalbind def % Parse a font file just enough to find the FontName or FontType. /.findfontvalue { % <file> <key> .findfontvalue <value> true @@ -243,10 +243,10 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put % Stack: key file false dup { 4 } { 3 } ifelse -2 roll closefile pop } { closefile pop //false } ifelse -} bind executeonly def +}.internalbind def /.findfontname { /FontName .findfontvalue - } bind def + }.internalbind def % If there is no FONTPATH, try to get one from the environment. NOFONTPATH { /FONTPATH () def } if @@ -259,8 +259,8 @@ ifelse % be replaced in the following section. % They are here so immediately evaulation will work, and allow them to % undefined at the bottom of the file. -/.scanfontbegin{} bind def -/.scanfontdir {} bind def +/.scanfontbegin{}.internalbind def +/.scanfontdir {}.internalbind def FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if /FONTPATH [ FONTPATH .pathlist ] def @@ -288,7 +288,7 @@ FONTPATH if pop } for - } bind def + }.internalbind def /.splitfilename { % <dir.../base.extn> .basename <base> <extn> % Make the file name read-only to detect aliasing bugs. % We really don't like doing this, but we've had one @@ -302,7 +302,7 @@ FONTPATH } { exch dup length 2 index length 1 add sub 0 exch getinterval exch } ifelse -} bind def +}.internalbind def /.scanfontdict 1 dict def % establish a binding /.scanfontbegin { % Construct the table of all file names already in Fontmap. @@ -322,7 +322,7 @@ FONTPATH } forall setglobal - } bind def + }.internalbind def /.scanfontskip mark % Strings are converted to names anyway, so.... /afm //true @@ -428,7 +428,7 @@ FONTPATH ifelse pop setglobal - } bind executeonly def + }.internalbind def %END FONTPATH @@ -450,7 +450,7 @@ FONTPATH } executeonly {pop} ifelse -} .bind executeonly odef +} .forcebind odef systemdict /NONATIVEFONTMAP known .setnativefontmapbuilt /.buildnativefontmap { % - .buildnativefontmap <bool> systemdict /.nativefontmapbuilt .knownget not @@ -494,7 +494,7 @@ systemdict /NONATIVEFONTMAP known .setnativefontmapbuilt % record that we've been run //true //.setnativefontmapbuilt } ifelse -} bind executeonly odef +}.internalbind odef % Create the dictionary that registers the .buildfont procedure % (called by definefont) for each FontType. @@ -522,7 +522,7 @@ buildfontdict 3 /.buildfont3 cvx put { dup wcheck not { dup maxlength dict .copydict } if } ifelse - } bind def + }.internalbind def /.completefont { { % Check for disabled platform fonts. NOPLATFONTS @@ -574,7 +574,7 @@ buildfontdict 3 /.buildfont3 cvx put } if readonly % stack: name fontdict } stopped { $error /command get /invalidfont signalerror } if -} bind executeonly odef +}.internalbind odef /definefont { dup rcheck not { /definefont cvx /invalidaccess signalerror @@ -592,7 +592,7 @@ buildfontdict 3 /.buildfont3 cvx put % If the font originated as a resource, register it. currentfile .currentresourcefile eq { dup .registerfont } if readonly - } .bind executeonly odef + } .forcebind odef % Define a procedure for defining aliased fonts. % We use this only for explicitly aliased fonts, not substituted fonts: @@ -644,7 +644,7 @@ buildfontdict 3 /.buildfont3 cvx put } ifelse exch setglobal - } bind executeonly odef % so findfont will bind it + }.internalbind odef % so findfont will bind it % Define .loadfontfile for loading a font. If we recognize Type 1 and/or % TrueType fonts, gs_type1.ps and/or gs_ttf.ps will redefine this. @@ -654,10 +654,10 @@ buildfontdict 3 /.buildfont3 cvx put userdict begin cvx exec end -} bind def +}.internalbind def /.setloadingfont { //systemdict /.loadingfont 3 -1 roll .forceput -} .bind executeonly odef % .forceput must be bound and hidden +} .forcebind odef % .forceput must be bound and hidden /.loadfont { % Some buggy fonts leave extra junk on the stack, % so we have to make a closure that records the stack depth @@ -669,7 +669,7 @@ buildfontdict 3 /.buildfont3 cvx put exit } loop % this loop is a pattern for execstack_lookup, don't remove ! //false .setloadingfont - } bind def + }.internalbind def % Find an alternate font to substitute for an unknown one. % We go to some trouble to parse the font name and extract @@ -750,7 +750,7 @@ buildfontdict 3 /.buildfont3 cvx put } { /stringtype ne { pop () } if } ifelse -} bind def +}.internalbind def /.fontnameproperties { % <int> <string|name> .fontnameproperties % <int'> @@ -764,7 +764,7 @@ buildfontdict 3 /.buildfont3 cvx put pop pop } ifelse } forall pop -} bind def +}.internalbind def /.substitutefamilies mark /AvantGarde {/AvantGarde-Book /AvantGarde-BookOblique @@ -792,7 +792,7 @@ buildfontdict 3 /.buildfont3 cvx put /.nametostring { % <name> .nametostring <string> % <other> .nametostring <other> dup type /nametype eq { .namestring } if -} bind def +}.internalbind def /.substitutefontname { % <fontname> <properties> .substitutefontname % <altname|null> @@ -823,7 +823,7 @@ buildfontdict 3 /.buildfont3 cvx put } ifelse } forall pop 1 index length mod get exec -} bind executeonly odef +}.internalbind odef /.substitutefont { % <fontname> .substitutefont <altname> dup 0 exch //.fontnameproperties exec .substitutefontname % Only accept fonts known in the Fontmap. @@ -832,7 +832,7 @@ buildfontdict 3 /.buildfont3 cvx put .nativeFontmap 1 index known not {pop defaultfontname } if } if -} bind executeonly odef +}.internalbind odef % If requested, make (and recognize) fake entries in FontDirectory for fonts % present in Fontmap but not actually loaded. Thanks to Ray Johnston for @@ -849,7 +849,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if } { 2 copy /FontName get findfont //definefont exch pop exch pop } ifelse -} bind odef +}.internalbind odef /scalefont { % <font> <scale> scalefont <font> 1 index /FontMatrix known { @@ -858,7 +858,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if 1 index /FontName get findfont 1 index //scalefont exch pop exch pop } ifelse -} bind odef +}.internalbind odef /makefont { % <font> <matrix> makefont <font> 1 index /FontMatrix known { @@ -867,7 +867,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if 1 index /FontName get findfont 1 index //makefont exch pop exch pop } ifelse -} bind odef +}.internalbind odef /setfont { % <font> setfont - dup /FontMatrix known { @@ -875,7 +875,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if } { dup /FontName get findfont //setfont pop } ifelse -} bind odef +}.internalbind odef %END FAKEFONTS @@ -891,10 +891,10 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if counttomark 1 sub { .aliasfont } repeat end % <fontname> mark <font> exch pop exch pop -} bind odef +}.internalbind odef /findfont { .findfont -} bind def +}.internalbind def % Check whether the font name we are about to look for is already on the list % of aliases we're accumulating; if so, cause an error. /.checkalias % -mark- <alias1> ... <name> .checkalias <<same>> @@ -908,7 +908,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if if } for - } bind def + }.internalbind def % Get a (non-fake) font if present in a FontDirectory. /.fontknownget % <fontdir> <fontname> .fontknownget <font> true % <fontdir> <fontname> .fontknownget false @@ -921,7 +921,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if { //false } ifelse - } bind def + }.internalbind def % This is the standard procedure for handling font substitution. % Its location is per an Adobe newsgroup posting. % It is called with the font name on the stack, standing in for findfont. @@ -953,7 +953,7 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if } if } ifelse /Font findresource -} bind executeonly def +}.internalbind def % Default font substitution does {pop /Courier} om many implementations. % GS post-process font substitution in .stdsubstfont and uses {} for @@ -973,7 +973,7 @@ $error /SubstituteFont { } put } { pop //false } ifelse -} bind def +}.internalbind def % Do the work of findfont, including substitution, defaulting, and % scanning of FONTPATH. /.dofindfont { % mark <fontname> .dofindfont % mark <alias> ... <font> @@ -1020,7 +1020,7 @@ $error /SubstituteFont { } put } ifelse } ifelse } if -} bind executeonly def +}.internalbind def % any user of .putgstringcopy must use bind and executeonly /.putgstringcopy % <dict> <name> <string> .putgstringcopy - @@ -1032,7 +1032,7 @@ $error /SubstituteFont { } put dup length string copy .forceput setglobal } executeonly ifelse -} .bind executeonly odef % must be bound and hidden for .forceput +} .forcebind odef % must be bound and hidden for .forceput /.loadfontloop { % <fontname> <filename> <libflag> .loadfontloop % <font> true @@ -1180,7 +1180,7 @@ $error /SubstituteFont { } put } loop % end of loop - } bind executeonly def % must be bound and hidden for .putgstringcopy + }.internalbind def % must be bound and hidden for .putgstringcopy % Attempt to load a font from a file. /.tryloadfont { % <fontname> .tryloadfont <font> true @@ -1199,7 +1199,7 @@ $error /SubstituteFont { } put } { {//true //.loadfontloop exec} //.internalstopped exec {//false} if } ifelse -} bind def +}.internalbind def % Try to find a font using only the present contents of Fontmap. /.tryfindfont { % <fontname> .tryfindfont <font> true @@ -1286,14 +1286,14 @@ $error /SubstituteFont { } put if } ifelse - } bind executeonly def + }.internalbind def % Define a procedure to load all known fonts. % This isn't likely to be very useful. /loadallfonts { [Fontmap .nativeFontmap] { { pop findfont pop } forall } forall -} bind def +}.internalbind def % If requested, load all the fonts defined in the Fontmap into FontDirectory % as "fake" fonts i.e., font dicts with only FontName and FontType defined. diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_icc.ps b/Master/tlpkg/tlgs/Resource/Init/gs_icc.ps index b6f04cc9fab..072ecaba00a 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_icc.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_icc.ps @@ -92,7 +92,7 @@ systemdict begin } { pop % Not interested in this DSC comment } ifelse -} bind def +} .internalbind def currentdict /cs-sig-dict undef diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_img.ps b/Master/tlpkg/tlgs/Resource/Init/gs_img.ps index 70262a92ed1..a3cef1c6c0c 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_img.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_img.ps @@ -199,7 +199,7 @@ def { pop //false } ifelse } -.bind def +.forcebind def % % Procedures to convert a set of stack entries to a dictionary. There is @@ -268,7 +268,7 @@ def currentdict end } -.bind def +.forcebind def % % <dict> <array> img_unbuild_dict <oper_0> ... <oper_n> @@ -287,7 +287,7 @@ def pop end } -.bind def +.forcebind def % % Check the image types that can be used as data sources @@ -374,7 +374,7 @@ def % stack: <w> <h> <bps> <mtx> <dsrc|dsrc_array> <multi> <n> //img_params_ary //img_build_dict exec } -.bind def +.forcebind def currentdict /good_image_types .undef % @@ -402,7 +402,7 @@ currentdict /good_image_types .undef } if } -.bind def +.forcebind def % % <width> <height> <polarity> <matrix> <dsrc> @@ -429,7 +429,7 @@ currentdict /good_image_types .undef % the imagemask dictionary can be built; do so //img_mask_params_ary //img_build_dict exec } -.bind def +.forcebind def % % <?dict?> @@ -454,7 +454,7 @@ currentdict /good_image_types .undef } if } -.bind def +.forcebind def % % <width> <height> <bits/component> <matrix> <dsrc_0> ... @@ -513,7 +513,7 @@ currentdict /good_image_types .undef } if } -.bind def +.forcebind def % % <width> <height> <bits/component> <matrix> <dsrc_0> ... @@ -534,7 +534,7 @@ systemdict /setcolorscreen .knownget { /colorimage .systemvar $error /errorname get signalerror } if } - .bind systemdict begin odef end + .forcebind systemdict begin odef end } if } @@ -634,7 +634,7 @@ if } ifelse } -.bind odef +.forcebind odef % An auxiliary function for checking whether an imagemask to be interpolated. /.is_low_resolution % <image dict> .is_low_resolution <bool> @@ -649,7 +649,7 @@ if } repeat .max 2 gt % arbitrary -} .bind def +} .forcebind def % % width height polarity matrix datasrc imagemask - @@ -712,7 +712,7 @@ if } ifelse } -.bind odef +.forcebind odef % undefine a bunch of local definitions [ diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_init.ps b/Master/tlpkg/tlgs/Resource/Init/gs_init.ps index f02a0da6235..b23baea37d7 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_init.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_init.ps @@ -34,7 +34,7 @@ % Interpreter library version number % NOTE: the interpreter code requires that the first non-comment token % in this file be an integer, and that it match the compiled-in version! -10021 +10030 % Check the interpreter revision. dup revision ne @@ -111,7 +111,19 @@ PDFSTEP { /PDFDEBUG //true def } if currentdict /PDFSTOPONERROR known /PDFSTOPONERROR exch def currentdict /PDFSTOPONWARNING known {/PDFSTOPONWARNING //true def /PDFSTOPONERROR //true def}{/PDFSTOPONWARNING //false def} ifelse currentdict /PDFNOCIDFALLBACK known /PDFNOCIDFALLBACK exch def + +% Versions of bind for use during startup: +% bind - normal "bind", honors DELAYBIND +% .bind - normal "bind", but ignores DELAYBIND +% .internalbind - as "bind" but forces the executeonly attribute +% .forcebind - as ".bind" but forces the executeonly attribute +% +% In general, for security and consistency startup code should use +% .internalbind or .forcebind, and only use bind/.bind when we +% cannot enforce executeonly on a given proc /.bind /bind load def +/.internalbind {bind executeonly} .bind 1 index exch .makeoperator def +/.forcebind {.bind executeonly} .bind 1 index exch .makeoperator def /VMDEBUG INITDEBUG {{print mark @@ -132,7 +144,7 @@ currentdict /PDFNOCIDFALLBACK known /PDFNOCIDFALLBACK exch def {{pop }} ifelse - .bind def + .forcebind def % This was a debugging switch removed in 9.22, no other software % should have had any regard for it, and even if testing its value @@ -253,14 +265,14 @@ currentdict /DEVICE known not % We can't use readline, because that imposes a line length limit. /.skipeof % <string> .skipeof - { currentfile exch 1 exch .subfiledecode flushfile - } .bind def + } .forcebind def % Define procedures to assist users who don't read the documentation. userdict begin /help { (Enter PostScript commands. '(filename) run' runs a file, 'quit' exits.\n) print flush - } .bind def + } .forcebind def end % Define =string, which is used by some PostScript programs even though @@ -288,7 +300,7 @@ userdict /=string 256 string put counttomark { (%stdout) (w) file exch 0 .writecvp } repeat pop - } .bind def + } .forcebind def QUIET not { //printgreeting exec flush } if currentdict /printgreeting .undef @@ -296,25 +308,25 @@ currentdict /printgreeting .undef % Define a special version of def for making operator procedures. /obind { % <name> <proc> obind <name> <oper> 1 index exch .makeoperator -} .bind def +} .forcebind def /odef { % <name> <proc> odef - 1 index exch .makeoperator def -} .bind def +} .forcebind def % Define procedures for accessing variables in systemdict and userdict % regardless of the contents of the dictionary stack. /.systemvar { % <name> .systemvar <value> //systemdict exch get -} .bind executeonly odef +} .forcebind odef /.systemexec { .systemvar exec -} .bind executeonly odef +} .forcebind odef /.userdict { % - .userdict <dict> /userdict .systemvar -} .bind executeonly odef +} .forcebind odef /.uservar { % <name> .uservar <value> .userdict exch get -} .bind executeonly odef +} .forcebind odef % If we're delaying binding, remember everything that needs to be bound later. DELAYBIND @@ -329,8 +341,10 @@ DELAYBIND } if .currentglobal //false .setglobal systemdict /.delaybind 2000 array .forceput + systemdict /.delayinternalbind 2000 array .forceput .setglobal userdict /.delaycount 0 put + userdict /.delayinternalcount 0 put % When we've done the delayed bind, we want to stop saving. % Detect this by the disappearance of .delaybind. /bind @@ -341,7 +355,17 @@ DELAYBIND { pop /.bind cvx exec } ifelse - } .bind odef + } .forcebind odef + + /.internalbind + { /.delayinternalbind .systemvar dup length 0 ne + { .delayinternalcount 2 index put + .userdict /.delayinternalcount .delayinternalcount 1 add put + } + { pop /.forcebind cvx exec + } + ifelse + } .forcebind odef } executeonly if .currentglobal //true .setglobal @@ -383,7 +407,7 @@ DELAYBIND } executeonly forall pop } executeonly ifelse -} .bind executeonly def +} .forcebind def /.applyundefinternalnames { @@ -395,7 +419,7 @@ DELAYBIND } executeonly forall pop } executeonly forall -} .bind executeonly def +} .forcebind def %**************** BACKWARD COMPATIBILITY **************** /hwsizedict mark /HWSize //null .dicttomark readonly def @@ -403,11 +427,11 @@ DELAYBIND 0 3 1 roll 3 index //hwsizedict .getdeviceparams exch pop exch pop aload pop 3 2 roll 0 exch //null exch .getbitsrect exch pop -} bind odef +} .internalbind odef currentdict /hwsizedict .undef /getdeviceprops { //null .getdeviceparams - } bind odef + } .internalbind odef % NOTE: Note sure why/if this needs to be a separate operator. Consider rolling this % implementation into /putdeviceprops ? @@ -419,14 +443,14 @@ currentdict /hwsizedict .undef /.putdeviceprops .systemvar exch signalerror } if - } bind executeonly odef -/.writecvs { 0 .writecvp } bind odef + } .internalbind odef +/.writecvs { 0 .writecvp } .internalbind odef %**************** DEPRECATED PROCEDURES **************** %**************** DO NOT USE THESE IN NEW CODE **************** % Keeping these because they have been around a long time and we don't want to break old code that's out in the wild -/max { .max } bind def % use .max instead -/min { .min } bind def % use .min instead +/max { .max } .internalbind def % use .max instead +/min { .min } .internalbind def % use .min instead %**************** END OF BACKWARD COMPATIBILITY SECTION **************** % Utility for removing all entries from a dictionary @@ -439,7 +463,7 @@ currentdict /hwsizedict .undef 1 index exch undef } loop pop -} bind def +} .internalbind def % Define predefined procedures substituting for operators, % in alphabetical order. @@ -461,7 +485,7 @@ userdict /#copies 1 put % /initgraphics { initgraphics systemdict /DeviceGray_array get setcolorspace } -.bind executeonly odef +.forcebind odef /currentmatrix { dup type /arraytype ne @@ -486,7 +510,7 @@ userdict /#copies 1 put pop } ifelse } if -} .bind executeonly odef +} .forcebind odef % Guard similarly against EndPage not popping its operand. /.endpage { % <reason> .endpage <print_bool> @@ -504,7 +528,7 @@ userdict /#copies 1 put } { 2 ne } ifelse -} .bind executeonly odef +} .forcebind odef % Define .currentnumcopies so it consults the NumCopies device parameter. /.numcopiesdict mark @@ -516,7 +540,7 @@ userdict /#copies 1 put { exch pop exch pop } { cleartomark #copies } ifelse -} .bind executeonly odef +} .forcebind odef /setcolorscreen where { pop % not in all Level 1 configurations /currentcolorscreen @@ -572,7 +596,7 @@ userdict /.echo.mode //true put $error /errorname //null put $error /errorinfo //null put 0 .setoserrno - } bind executeonly def + } .internalbind def % To satisfy the Genoa FTS, executive must be a procedure, not an operator. % Define the procedure used by .runfile, .runstdin and .runstring @@ -581,11 +605,11 @@ userdict /.echo.mode //true put /.execute { % <obj> .execute <stopped> stopped $error /newerror get and { /handleerror .systemvar exec flush //true } { //false } ifelse -} bind def +} .internalbind def % Define an execute analogue of runlibfile0. /execute0 { % <obj> execute0 - //.execute exec { /execute0 cvx 1 .quit } if -} bind def +} .internalbind def /executive { { prompt { (%statementedit) (r) .systemvmfile } stopped @@ -596,7 +620,7 @@ userdict /.echo.mode //true put if cvx { .runexec } //.execute exec pop } loop - } bind def + } .internalbind def currentdict /.execute .undef /filter @@ -607,7 +631,7 @@ currentdict /.execute .undef } odef % Internal uses of stopped that aren't going to do a stop if an error occurs % should use .internalstopped to avoid setting newerror et al. -/.internalstopped { //null 1 .stopped //null ne } bind executeonly def +/.internalstopped { //null 1 .stopped //null ne } .internalbind def % handleerror procedure as mentioned in the "Operators" section of the PLRM Section 8.2 % This invokes the handleerror procedure from errordict (unless we are running under a % JOBSERVER where we want to always use a defined error handler (many error handlers in @@ -617,9 +641,9 @@ currentdict /.execute .undef % won't cause nested errors (Unexpected Error conditions). /handleerror //systemdict /JOBSERVER get{ - { /.GShandleerror .systemvar //.internalstopped exec pop } bind % always use .GShandleerror. + { /.GShandleerror .systemvar //.internalstopped exec pop } .internalbind % always use .GShandleerror. } { - { /errordict .systemvar /handleerror get //.internalstopped exec pop } bind % PLRM standard errorhandling + { /errordict .systemvar /handleerror get //.internalstopped exec pop } .internalbind % PLRM standard errorhandling } ifelse def /identmatrix [1.0 0.0 0.0 1.0 0.0 0.0] readonly def /identmatrix { @@ -635,13 +659,13 @@ currentdict /.execute .undef (GS) print count 0 ne { (<) print count =only } if (>) print flush -} bind def -/prompt { flush flushpage //systemdict /NOPROMPT get not { //.promptmsg exec} if } bind def +} .internalbind def +/prompt { flush flushpage //systemdict /NOPROMPT get not { //.promptmsg exec} if } .internalbind def currentdict /.promptmsg .undef -/pstack { 0 1 count 3 sub { index == } for } bind def +/pstack { 0 1 count 3 sub { index == } for } .internalbind def /putdeviceprops - { .putdeviceprops { erasepage } if } bind executeonly odef + { .putdeviceprops { erasepage } if } .internalbind odef /quit { /quit load 0 .quit } odef /run { dup type /filetype ne { (r) .systemvmfile } if % We must close the file when execution terminates, @@ -663,7 +687,7 @@ currentdict /.promptmsg .undef % startjob replaces the null on the o-stack with a procedure % to be executed when we get back here. dup //null ne { exec //true } { pop //false } ifelse -} bind executeonly def +} .internalbind def /.runexec2 { % <continue> <file|fileproc> .runexec2 - exch { .runexec @@ -671,10 +695,10 @@ currentdict /.promptmsg .undef dup type /filetype ne { cvx exec } if closefile } ifelse -} bind def +} .internalbind def /.runexec { % <file|fileproc> .runexec - cvlit /.runexec1 cvx 1 index /.runexec2 cvx 4 .execn -} bind def +} .internalbind def % The following is only for compatibility with Adobe interpreters. /setdash { 0 .argindex type dup /integertype eq exch /realtype eq or not { @@ -730,7 +754,7 @@ odef pop } ifelse echo } ifelse -} bind executeonly def +} .internalbind def /.confirm { //systemdict /DISPLAYING get //systemdict /NOPAUSE get not //systemdict /TTYPAUSE get or and { @@ -742,7 +766,7 @@ odef } { pop } ifelse -} bind executeonly def +} .internalbind def % In LanguageLevel 3, copypage erases the page. /copypage { @@ -754,7 +778,7 @@ odef } if pop systemdict /..page_default_spaces .knownget { //.PurgeDict exec } if .beginpage -} .bind executeonly odef +} .forcebind odef /showpage { 0 .endpage .doneshowpage { @@ -772,11 +796,11 @@ odef { initgraphics } ifelse systemdict /..page_default_spaces .knownget { //.PurgeDict exec } if .beginpage -} .bind executeonly odef +} .forcebind odef % Code output by Adobe Illustrator relies on the fact that % `stack' is a procedure, not an operator!!! -/stack { 0 1 count 3 sub { index = } for } bind def +/stack { 0 1 count 3 sub { index = } for } .internalbind def /start { //systemdict /BATCH get { //null 0 .quit } { executive } ifelse } def /store { % Don't alter operands before completing. 1 .argindex where { 2 index 2 index put pop pop } { def } ifelse @@ -809,7 +833,7 @@ currentdict /.typenames .undef /ifelse .systemvar ] cvx executeonly exch .setglobal -} executeonly def +} def systemdict /internaldict dup .makeinternaldict .makeoperator .forceput % proc is local, systemdict is global currentdict /.makeinternaldict .undef @@ -822,27 +846,27 @@ currentdict /.makeinternaldict .undef { exch dup length 2 index length add string % str2 str1 new dup dup 4 2 roll copy % str2 new new new1 length 4 -1 roll putinterval - } bind def + } .internalbind def /copyarray - { dup length array copy } bind def + { dup length array copy } .internalbind def % Copy a dictionary per the Level 2 spec even in Level 1. /.copydict % <fromdict> <todict> .copydict <todict> - { dup 3 -1 roll { put dup } forall pop } bind def + { dup 3 -1 roll { put dup } forall pop } .internalbind def /findlibfile { .systemvmlibfile { dup .filename pop exch //true } { //false } ifelse } odef /.growdictlength % get size for growing a dictionary { length 3 mul 2 idiv 1 add - } bind def + } .internalbind def /.growdict % grow a dictionary { dup //.growdictlength exec .setmaxlength - } bind def + } .internalbind def /.growput % put, grow the dictionary if needed { 2 index length 3 index maxlength eq { 3 copy pop known not { 2 index //.growdict exec} if } if put - } bind def + } .internalbind def % .localvmarray may be an operator: see zsysvm.c. /.localvmarray where { pop @@ -850,7 +874,7 @@ currentdict /.makeinternaldict .undef /.localvmarray { .currentglobal //false .setglobal exch array exch .setglobal - } bind def + } .internalbind def } ifelse /.localvmdict where { pop @@ -858,22 +882,22 @@ currentdict /.makeinternaldict .undef /.localvmdict { .currentglobal //false .setglobal exch dict exch .setglobal - } bind def + } .internalbind def } ifelse /.packtomark - { counttomark packedarray exch pop } bind def + { counttomark packedarray exch pop } .internalbind def /runlibfile - { % We don't want to bind 'run' into this procedure, + { % We don't want to .internalbind 'run' into this procedure, % since run may get redefined. findlibfile { exch pop /run .systemvar exec } { /undefinedfilename signalerror } ifelse - } bind def + } .internalbind def /selectdevice - { finddevice setdevice .setdefaultscreen } bind def + { finddevice setdevice .setdefaultscreen } .internalbind odef /signalerror % <object> <errorname> signalerror - - { /errordict .systemvar exch get exec } bind def + { /errordict .systemvar exch get exec } .internalbind def /signaloperror { % <object> <errorname> signaloperror - % Same as signalerror, except that if we are inside a pseudo-operator % or .errorexec, we use its error object, just as errors generated by @@ -881,24 +905,135 @@ currentdict /.makeinternaldict .undef /errordict .systemvar exch get .finderrorobject { 3 -1 roll pop exch } if exec -} bind def +} .internalbind def % Define the =[only] procedures. Also define =print, % which is used by some PostScript programs even though % it isn't documented anywhere. /write=only { .writecvs -} bind def +} .internalbind def /write= { 1 index exch write=only (\n) writestring -} bind def -/=only { (%stdout) (w) file exch write=only } bind odef -/= { =only (\n) print } bind def +} .internalbind def +/=only { (%stdout) (w) file exch write=only } .internalbind odef +/= { =only (\n) print } .internalbind def /=print /=only load def % Temporarily define == as = for the sake of runlibfile0. /== /= load def -% The following procedures are documented. +% Function to purge a named device from the device cache. This is required if we +% want to 'reset' a device. The setpagedevice implementation, when it creates a +% device instance, stores it in a cache. Next time we select a device we look in +% the cache and, if we find we cached it, then we use the cached device. +% +% Presumably this is intended as an optimisation, but it defeats the expected use +% of save and restore wihth devices because, after we restore a device away it is +% not destroyed, it is in the cache. Requesting the same named device will return +% the cached device, crucially *without* resetting any of its parameters. In +% particular NumPages which is used to number output files and is a read-only parameter. +% +% /name uncachedevice - +% +/uncachedevice +{ + % Check we've been given a name + dup type /nametype eq + { + % Check the name isn't the current device. Check both /Name + % and /OutputDevice. There seem to be some conditions where + % only one is present. + % + currentpagedevice /Name known + { + dup currentpagedevice /Name get eq + } + { + //false + }ifelse + currentpagedevice /OutputDevice known + { + 1 index currentpagedevice /OutputDevice get eq + } + { + //false + }ifelse + + % We tested /Name and /OutputDevice to see if they exist, if they do + % we checked them against the requested device. If either matches the requested + % device we report an error, otherwise we remove the device from the cache. + % + or + { + (*** ERROR: Can't uncache the current device\n) print + /uncachedevice /invalidaccess signalerror + } + { + % Make sure devicedict exists, if it does not, ignore + % the request because this code doesn't know how to + % deal with this PostScript itnerpreter. + /devicedict where + { + % Get devicedict out of its containing dictionary + /devicedict get dup % stack: /device -devicedict- -devicedict- + + % Check if the device we were given is known + 2 index known % stack: /device -devicedict- bool + { + % device was known, get the key/value pair from devicedict + dup 2 index get % stack: /device -devicedict- value + + % We expect the value in devicedict to be an array, check it is + dup type /arraytype eq + { + dup 1 null put % stack: /device -devicedict- [-device- null] + 3 -1 roll exch % stack: -devicedict- /device [-device- null] + put % stack: - + } + { + % Value in devicedict associated with the named key is not an array + /uncachedevice /typecheck signalerror + } ifelse + } + { + % The named key is not present in devicedict + /uncachedevice /undefined signalerror + } ifelse + } if + } ifelse + } + { + % The parameter we were given wasn't a name type + /uncachedevice /typecheck signalerror + } ifelse +} bind readonly odef + +% Function to purge all but the current device from the device cache +% +% - purgedevicecache - +% +/purgedevicecache +{ + % Find devicedict, if it doesn't exist just exit silently, we don't know + % how to deal with this PostScript interpreter + /devicedict where + { + % Get devicedict from the containing dictionary + /devicedict get + % For each key/value pair in devicedict + { + pop % Discard the value + dup currentpagedevice /Name get eq not % Check if the key is the same as the current device + { + uncachedevice % If not, purge the device from the cache + } + { + pop % Don't purge the current device + } ifelse + } forall + } if +} bind readonly odef + /finddevice { % <devicename> finddevice <device> /devicedict .systemvar exch get dup 1 get //null eq { @@ -909,7 +1044,9 @@ currentdict /.makeinternaldict .undef dup dup 0 get //false .copydevice2 1 exch put exch .setglobal } if 1 get -} bind executeonly odef +} .internalbind odef + +% The following procedures are documented. % Run a resource file. This allows us to distinguish resource objects % from objects coming from input files. @@ -922,10 +1059,10 @@ userdict /.currentresourcefile //null put 2 .execn % stopped <file> .userdict /.currentresourcefile 3 -1 roll put { stop } if -} bind executeonly def +} .internalbind def /.runresource { % <file> .runresource - { /run .systemvar exec } .execasresource -} bind def +} .internalbind def % Convenience function (documented extension) /.shellarguments % -> shell_arguments true (or) false @@ -935,7 +1072,7 @@ userdict /.currentresourcefile //null put { pop //false } ifelse } { //false } ifelse - } bind def + } .internalbind def % Define the procedure that the C code uses for running files % named on the command line. @@ -947,13 +1084,13 @@ userdict /.currentresourcefile //null put % reopened if a startjob does a restore. /.runstdin { { { (%stdin) (r) file cvx } .runexec } execute0 -} bind def +} .internalbind def % Define the procedure that the C code uses for running commands % given on the command line with -c. We turn the string into a file so that % .runexec can do the right thing with a startjob. /.runstring { 0 0 .systemvmstring .systemvmSFD cvx { .runexec } execute0 -} bind def +} .internalbind def % Define the procedure that the C code uses to set up for executing % a string that may be received in pieces. @@ -973,7 +1110,7 @@ def /.runstringbegin { 1 .systemvmarray dup 0 //.needinput 0 get put cvx % { .needinput } in systemvm 0 0 .systemvmstring .systemvmSFD cvx .runexec -} bind executeonly def +} .internalbind def % Define a special version of runlibfile that aborts on errors. /runlibfile0 @@ -989,7 +1126,7 @@ def { (While reading ) print .currentfilename print (:\n) print flush /handleerror .systemvar exec /runlibfile0 1 .quit } if - } bind def + } .internalbind def % Temporarily substitute it for the real runlibfile. /.runlibfile /runlibfile load def /runlibfile //runlibfile0 def @@ -1020,40 +1157,44 @@ currentdict /runlibfile0 .undef { not exch pop exit } { pop } ifelse } for exch pop .quit - } bind executeonly def + } .internalbind def +/.acquire_$error { + //systemdict /$error get +} .internalbind def + /.errorhandler % <command> <errorname> .errorhandler - { % Detect an internal 'stopped'. 1 .instopped { //null eq { pop pop stop } if } if - $error /.inerror get 1 .instopped { pop } { pop //true } ifelse + //.acquire_$error exec /.inerror get 1 .instopped { pop } { pop //true } ifelse { //.unstoppederrorhandler exec } if % detect error recursion - $error /globalmode .currentglobal //false .setglobal put - $error /.inerror //true put - $error /newerror //true put - $error exch /errorname exch put - $error exch /command exch put - $error /errorinfo known not { $error /errorinfo //null put } if - $error /recordstacks get $error /errorname get /VMerror ne and + //.acquire_$error exec /globalmode .currentglobal //false .setglobal put + //.acquire_$error exec /.inerror //true put + //.acquire_$error exec /newerror //true put + //.acquire_$error exec exch /errorname exch put + //.acquire_$error exec exch /command exch put + //.acquire_$error exec /errorinfo known not { //.acquire_$error exec /errorinfo //null put } if + //.acquire_$error exec /recordstacks get //.acquire_$error exec /errorname get /VMerror ne and { % Attempt to store the stack contents atomically. - count array astore dup $error /ostack 4 -1 roll + count array astore dup //.acquire_$error exec /ostack 4 -1 roll % Grab the execstack, then remove to two elements that are from % this error handler (not interesting). countexecstack array execstack dup length 2 sub 0 exch getinterval - $error /estack 3 -1 roll - countdictstack array dictstack $error /dstack 3 -1 roll + //.acquire_$error exec /estack 3 -1 roll + countdictstack array dictstack //.acquire_$error exec /dstack 3 -1 roll put put put aload pop } - { $error /dstack .undef - $error /estack .undef - $error /ostack .undef + { //.acquire_$error exec /dstack .undef + //.acquire_$error exec /estack .undef + //.acquire_$error exec /ostack .undef } ifelse - $error /position currentfile status + //.acquire_$error exec /position currentfile status { currentfile { fileposition } //.internalstopped exec { pop //null } if } { % If this was a scanner error, the file is no longer current, % but the command holds the file, which may still be open. - $error /command get dup type /filetype eq + //.acquire_$error exec /command get dup type /filetype eq { { fileposition } //.internalstopped exec { pop //null } if } { pop //null } ifelse @@ -1061,10 +1202,10 @@ currentdict /runlibfile0 .undef ifelse put % During initialization, we don't reset the allocation % mode on errors. - $error /globalmode get $error /.nosetlocal get and .setglobal - $error /.inerror //false put + //.acquire_$error exec /globalmode get //.acquire_$error exec /.nosetlocal get and .setglobal + //.acquire_$error exec /.inerror //false put stop - } bind executeonly def + } .internalbind def currentdict /.unstoppederrorhandler .undef % Define the standard handleerror. We break out the printing procedure @@ -1146,9 +1287,10 @@ currentdict /.unstoppederrorhandler .undef { (Current file position is ) print position = } if -} bind executeonly def +} .internalbind def /.printerror -{ $error begin newerror +{ + //.acquire_$error exec begin newerror { /command load errorname //systemdict /SHORTERRORS get { (%%[ Error: ) print =only flush @@ -1193,7 +1335,8 @@ currentdict /.unstoppederrorhandler .undef ifelse % newerror end flush -} bind executeonly def +} .internalbind def +currentdict /.acquire_$error .undef currentdict /.printerror_long .undef % Define $error. This must be in local VM. @@ -1239,10 +1382,10 @@ currentdict /errordict ErrorNames length 3 add dict 3 1 roll mark 1 index systemdict /.errorhandler get /exec load //.packtomark exec cvx put .setglobal - } bind def + } .internalbind def /.registererror % <name> .registererror - { errordict exch //.registererror2 exec - } bind def + } .internalbind def currentdict /.registererror2 .undef ErrorNames @@ -1255,7 +1398,7 @@ errordict begin } forall /handleerror % this key is 'well known' and some PS may redefine it { /.printerror .systemvar exec - } bind def + } .internalbind def end % errordict gserrordict /unknownerror errordict /unknownerror get put @@ -1277,7 +1420,7 @@ errordict /unknownerror .undef noaccess pop //systemdict /.setsafeerrors .forceundef //systemdict /.SAFERERRORLIST .forceundef -} bind executeonly odef +} .internalbind odef SAFERERRORS {.setsafererrors} if @@ -1288,13 +1431,13 @@ SAFERERRORS {.setsafererrors} if % Define the [write]==[only] procedures. /.dict 8 dict dup begin def - /.cvp {1 index exch 1 .writecvp} bind def - /.p {1 index exch writestring} bind def - /.p1 {2 index exch writestring} bind def - /.p2 {3 index exch writestring} bind def + /.cvp {1 index exch 1 .writecvp} .internalbind def + /.p {1 index exch writestring} .internalbind def + /.p1 {2 index exch writestring} .internalbind def + /.p2 {3 index exch writestring} .internalbind def /.print { dup type .dict exch .knownget { exec } { .cvp } ifelse - } bind def + } .internalbind def /arraytype {dup rcheck {() exch dup xcheck @@ -1308,20 +1451,20 @@ begin def (])} ifelse exch pop .p} {.cvp} - ifelse} bind def + ifelse} .internalbind def /packedarraytype /arraytype load def {//.dict begin .print pop end} - bind + .bind end /write==only exch def -/write== {1 index exch write==only (\n) writestring} bind def -/==only { (%stdout) (w) file exch write==only } bind def -/== {==only (\n) print} bind def - +/write== {1 index exch write==only (\n) writestring} .internalbind def +/==only { (%stdout) (w) file exch write==only } .internalbind def +/== {==only (\n) print} .internalbind def % Define [write]===[only], an extension that prints dictionaries % in readable form and doesn't truncate strings. /.dict /write==only load 0 get dup length 2 add dict .copydict dup + begin def /dicttype { dup rcheck @@ -1334,19 +1477,19 @@ begin def { .cvp } ifelse - } bind def + } .internalbind def /stringtype { 1 index exch 2 .writecvp - } bind def + } .internalbind def {//.dict begin .print pop end} - bind + .internalbind end /write===only exch def -/write=== {1 index exch write===only (\n) writestring} bind def -/===only { (%stdout) (w) file exch write===only } bind def -/=== { ===only (\n) print } bind def +/write=== {1 index exch write===only (\n) writestring} .internalbind def +/===only { (%stdout) (w) file exch write===only } .internalbind def +/=== { ===only (\n) print } .internalbind def % Create the initialization queue. 1183615869 internaldict dup @@ -1362,7 +1505,7 @@ end } if .delayed_init_queue 3 1 roll .growput end -} bind def +} .internalbind def begin /.execute_scheduled_inits % - .execute_scheduled_inits - @@ -1387,7 +1530,7 @@ begin } loop currentdict /.newdelayed_init_queue undef end -} bind def +} .internalbind def end (END PROCS) VMDEBUG @@ -1403,10 +1546,10 @@ currentdict % Define .findencoding. (This is redefined in Level 2.) /.findencoding { //EncodingDirectory exch get exec - } bind def + } .internalbind def /.defineencoding { //EncodingDirectory 3 1 roll put - } bind def + } .internalbind def % If we've got the composite font extensions, define findencoding. % To satisfy the Genoa FTS, findencoding must be a procedure, not an operator. /rootfont where { pop /findencoding { .findencoding } def } if @@ -1416,7 +1559,7 @@ currentdict % exist for the sake of toolbin/encs2c.ps. /.registerencoding { % <index> <array> .registerencoding - pop pop -} bind odef +} .internalbind odef % Load StandardEncoding. %% Replace 1 (gs_std_e.ps) @@ -1538,12 +1681,12 @@ devicedict /Default devicedict .defaultdevicename get put { 3 copy 6 copy //setcolorscreen } { //setscreen } ifelse -} bind def +} .internalbind def /.setloresscreen { % <dpi> .setloresscreen - .setloreshalftone 0 array cvx settransfer % Genoa CET won't accept a packed array! /setstrokeadjust where { pop //true setstrokeadjust } if -} bind def +} .internalbind def % Use a 45-degree spot screen for high-resolution devices. % The PS3 CET insists that the screen be an array and not a packedarray (!). currentpacking //false setpacking @@ -1631,7 +1774,7 @@ setpacking { //setscreen % not high resolution } ifelse -} bind def +} .internalbind def /.sethiresscreen { % <dpi> .sethiresscreen .sethireshalftone % pushes true if a screen halftone used % Stack: doscree @@ -1664,7 +1807,7 @@ setpacking % Increase fill adjustment so that we effectively use Adobe's % any-part-of-pixel rule. 0.5 dup .setfilladjust2 -} bind def +} .internalbind def % Set the default screen and BG/UCR. % We define the proc here, rather than inline in .setdefaultbgucr @@ -1678,12 +1821,12 @@ setpacking (%.defaultbgrucrproc) cvn load dup setblackgeneration setundercolorremoval } if -} bind def +} .internalbind def /.useloresscreen { % - .useloresscreen <bool> % Compute min(|dpi x|,|dpi y|) as the definition of the resolution. 72 72 matrix defaultmatrix dtransform abs exch abs .min dup 150 lt //systemdict /DITHERPPI known not and -} bind def +} .internalbind def /.gsgetdeviceprop % <device> <propname> gsgetdeviceprop <value> { 2 copy mark exch //null .dicttomark .getdeviceparams @@ -1691,7 +1834,7 @@ setpacking { pop dup /undefined signalerror } { 5 1 roll pop pop pop pop } ifelse - } bind def + } .internalbind def % The following implementation uses LL2 extensions, but only in stopped % contexts so that with LL1, the .set??reshalftone will be used. @@ -1712,7 +1855,7 @@ setpacking { pop pop //false } { //true } ifelse } if -} bind def +} .internalbind def currentdict /.gsgetdeviceprop .forceundef /.setdefaulthalftone { @@ -1722,12 +1865,12 @@ currentdict /.gsgetdeviceprop .forceundef //.useloresscreen exec { .setloreshalftone } { .sethireshalftone pop } ifelse } ifelse -} bind def +} .internalbind def /.setdefaultscreen { //.useloresscreen exec { .setloresscreen } { .sethiresscreen } ifelse //.setdefaultbgucr exec -} bind def +} .internalbind def currentdict /.setdefaultbgucr .undef currentdict /.useloresscreen .undef @@ -1780,7 +1923,7 @@ currentdict /.useloresscreen .undef 2 index 2 index 3 -1 roll put 1 add } for 0 exch getinterval exch pop -} bind def +} .internalbind def % false <dir_list> <template> .generate_dir_list_templates_with_length <t1> ... <tN> % true <dir_list> <template> .generate_dir_list_templates_with_length <t1> <l1> ... <tN> <ln> @@ -1872,7 +2015,7 @@ currentdict /.useloresscreen .undef } forall } ifelse % (t1) ?l1 (t2) ?l2 ... (tN) ?ln {} b [dl] (templ) (ffn) pop pop pop pop pop % (t1) ?l1 (t2) ?l2 ... (tN) ?ln -} .bind executeonly odef +} .forcebind odef currentdict /.makepathtemplate .undef % <dir_list> <template> .generate_dir_list_templates <t1> ... <tN> @@ -1882,12 +2025,12 @@ currentdict /.makepathtemplate .undef % /.generate_dir_list_templates { //false 3 1 roll //.generate_dir_list_templates_with_length -} .bind executeonly odef +} .forcebind odef % Load the initialization files for optional features. %% Replace 4 INITFILES systemdict /INITFILES known - { INITFILES { <00> search { exch pop dup runlibfile VMDEBUG }{ dup runlibfile VMDEBUG exit } ifelse } .bind loop + { INITFILES { <00> search { exch pop dup runlibfile VMDEBUG }{ dup runlibfile VMDEBUG exit } ifelse } .forcebind loop } if @@ -1910,7 +2053,7 @@ if /FontName () def /Encoding StandardEncoding def /FontBBox { 0 0 0 0 } readonly def % executable is bogus, but customary ... - /BuildChar { pop pop 0 0 setcharwidth } bind def + /BuildChar { pop pop 0 0 setcharwidth } .internalbind def /PaintType 0 def % shouldn't be needed! end /NullFont exch definefont setfont @@ -1943,7 +2086,7 @@ currentdict /.runlibfile .undef { dup type /operatortype eq { % This might be a real operator, so bind might cause a typecheck - {.bind} //.internalstopped exec pop + {.forcebind} //.internalstopped exec pop } if pop pop } forall @@ -2153,7 +2296,7 @@ gsave % This is a hack to get around problems % in some common PostScript-generating applications. <04> cvn JOBSERVER { - { { clear cleardictstack //false 0 .startnewjob } 2 .stop } bind + { { clear cleardictstack //false 0 .startnewjob } 2 .stop } .internalbind } { { } } ifelse def @@ -2170,13 +2313,13 @@ gsave } { {currentfile (%-12345X) .peekstring pop (%-12345X) eq <04> cvn load if} -} ifelse bind def +} ifelse .internalbind def <1b45> cvn { } def % PJL reset prologue (ESC E) <1b451b> cvn <1b> cvn load def % PJL reset epilogue (ESC E + UEL) (\001M) cvn % TBCP initiator { currentfile /TBCPDecode filter cvx exec - } bind def + } .internalbind def /@PJL % H-P job control { % Windows 2000 driver includes PJL into %%BeginFeature block. @@ -2193,7 +2336,7 @@ gsave } if } if currentfile //=string readline pop pop - } bind def + } .internalbind def % Install the EPS handler if needed systemdict /EPSBoundingBoxInit known { EPSBoundingBoxInit } if @@ -2219,7 +2362,7 @@ readonly def {systemdict exch .forceundef} forall //systemdict /SAFERUndefinePostScriptOperators .forceundef -} .bind executeonly def % must be bound and hidden for .forceundef +} .forcebind def % must be bound and hidden for .forceundef /tempfilepaths [ @@ -2270,7 +2413,7 @@ readonly def .activatepathcontrol } ifelse -} bind def +} .internalbind def /.locksafe_userparams { SAFETY /safe get not { @@ -2309,7 +2452,7 @@ readonly def >> setuserparams } if -} .bind executeonly def +} .forcebind def currentdict /tempfilepaths undef @@ -2325,7 +2468,7 @@ currentdict /tempfilepaths undef << /.LockSafetyParams //true >> setpagedevice setglobal //SAFETY /safe //true .forceput % overrides readonly -} .bind executeonly odef +} .forcebind odef /.setsafe { @@ -2347,7 +2490,7 @@ currentdict /tempfilepaths undef } if } ifelse -} .bind executeonly odef +} .forcebind odef %% --- End documented extensions --- % This is only used during startup. Its required so that @@ -2369,7 +2512,7 @@ currentdict /tempfilepaths undef >> setpagedevice setglobal //SAFETY /safe //true .forceput % overrides readonly -} .bind def +} .forcebind def % See /.locksafeglobal above. % @@ -2393,7 +2536,7 @@ currentdict /tempfilepaths undef } if } ifelse -} .bind executeonly odef +} .forcebind odef % If we are running in SAFER mode, lock things down SAFER { .setsafeglobal } if @@ -2410,7 +2553,7 @@ currentdict /.locksafeglobal .undef /OLDPDF where {/OLDPDF get not {/SHA256Encode /MD5Encode /AESDecode /JPXDecode /JBIG2Decode /ArcfourDecode /.EOFDecode} if} if ] {filterdict exch undef} forall -} .bind executeonly def +} .forcebind def /UndefinePostScriptOperators { % This list is of operators which no longer appear to be used, and which we do not believe @@ -2555,7 +2698,7 @@ currentdict /.locksafeglobal .undef //systemdict /UndefinePostScriptFilters .forceundef //systemdict /UndefinePostScriptOperators .forceundef -} .bind executeonly def % must be bound and hidden for .forceundef +} .forcebind def % must be bound and hidden for .forceundef % If we delayed binding, make it possible to do it later. /.bindnow { @@ -2566,8 +2709,10 @@ currentdict /.locksafeglobal .undef % Temporarily disable the typecheck error. errordict /typecheck 2 copy get errordict /typecheck { pop } put % pop the command - 0 1 .delaycount 1 sub { .delaybind exch get .bind pop } for + 0 1 .delaycount 1 sub { .delaybind exch get .forcebind pop } for + 0 1 .delayinternalcount 1 sub { .delayinternalbind exch get .forcebind pop } for //systemdict /.delaybind {} .forceput % reclaim the space + //systemdict /.delayinternalbind {} .forceput % reclaim the space //systemdict /.bindnow .forceundef % ditto .applyundefinternalnames put @@ -2584,10 +2729,12 @@ currentdict /.locksafeglobal .undef //systemdict /.undefinternalnames .forceundef //systemdict /.applyundefinternalnames .forceundef //systemdict /.undefinternalnameslist .forceundef + //systemdict /.internalbind .forceundef + //systemdict /.forcebind .forceundef currentuserparams /IdiomRecognition known { 1 dict dup /IdiomRecognition 4 -1 roll put setuserparams } if -} .bind def +} .forcebind def % Turn off array packing, since some PostScript code assumes that % procedures are writable. @@ -2685,6 +2832,8 @@ systemdict /.setCPSImode .undef % must be after gs_cet.ps DELAYBIND not { systemdict /.bindnow .undef % We only need this for DELAYBIND + systemdict /.internalbind .undef + systemdict /.forcebind .undef systemdict /.forcecopynew .undef % remove temptation systemdict /.forceput .undef % ditto systemdict /.forceundef .undef % ditto diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps b/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps index 287202250b8..0111a8784d0 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps @@ -46,7 +46,7 @@ level2dict begin % Check parameters that are managed at the PostScript level. /.checkparamtype { % <newvalue> <type> .checkparamtype <bool> exch type eq -} .bind def +} .forcebind def /.checksetparams { % <newdict> <opname> <checkdict> % .checksetparams <newdict> 2 .argindex { @@ -64,7 +64,7 @@ level2dict begin pop } ifelse pop pop } forall pop pop -} .bind def +} .forcebind def % currentuser/systemparams creates and returns a dictionary in the % current VM. The easiest way to make this work is to copy any composite @@ -101,7 +101,7 @@ level2dict begin 1 index length string exch .setglobal copy exch not { readonly } if } if -} .bind odef +} .forcebind odef % Some user parameters are managed entirely at the PostScript level. % We take care of that here. @@ -119,7 +119,7 @@ counttomark 2 idiv { psuserparams 3 copy pop type cvlit //.checkparamtype /exec load 3 packedarray cvx put userparams 3 1 roll put -} .bind def +} .forcebind def end /currentuserparams { % - currentuserparams <dict> /userparams .systemvar dup length dict .copydict @@ -164,12 +164,12 @@ end % Set them again to the new values. From here on, we are safe, % since a context switch will consult userparams. .setuserparams -} .bind executeonly odef % must be bound and hidden for .forceput +} .forcebind odef % must be bound and hidden for .forceput /setuserparams { % <dict> setuserparams - {.setuserparams2} stopped {/setuserparams load $error /errorname get signalerror} if -} .bind odef +} .forcebind odef % Initialize user parameters managed here. /JobName () .definepsuserparam @@ -177,7 +177,7 @@ end % (Since userparams is in local VM, save takes care of saving them.) /restore { % <save> restore - //restore /userparams .systemvar .setuserparams -} .bind odef +} .forcebind odef % The pssystemparams dictionary holds some system parameters that % are managed entirely at the PostScript level. @@ -231,7 +231,7 @@ end ifelse } executeonly forall pop -} .bind executeonly odef +} .forcebind odef % Initialize the passwords. % NOTE: the names StartJobPassword and SystemParamsPassword are known to @@ -246,7 +246,7 @@ end stopped { /setcachelimit .systemvar $error /errorname get signalerror } if -} .bind odef +} .forcebind odef /setcacheparams { % The MaxFontCache parameter is a system parameter, which we might % not be able to set. Fortunately, this doesn't matter, because @@ -260,7 +260,7 @@ end .dicttomark { setuserparams cleartomark } stopped { /setcacheparams .systemvar $error /errorname get signalerror } if -} .bind odef +} .forcebind odef % Add bogus user and system parameters to satisfy badly written PostScript % programs that incorrectly assume the existence of all the parameters @@ -292,7 +292,7 @@ end } ifelse //true - } .bind def + } .forcebind def % Initialize the File Permission access control to wide open % These will only be accessed via current/set userparams. % Values are a string containing multiple nul terminated path strings @@ -342,20 +342,20 @@ dup /RamSize 4194304 .forceput pop //false } ifelse } ifelse -} .bind def +} .forcebind def /ProcessComment //null .definepsuserparam psuserparams /ProcessComment {//.checkprocesscomment exec} put (%ProcessComment) cvn { /ProcessComment getuserparam dup //null eq { pop pop pop } { exec } ifelse -} bind def +} .internalbind def /ProcessDSCComment //null .definepsuserparam psuserparams /ProcessDSCComment {//.checkprocesscomment exec} put /.loadingfont //false def (%ProcessDSCComment) cvn { /ProcessDSCComment getuserparam dup //null eq .loadingfont or { pop pop pop } { exec } ifelse -} bind def +} .internalbind def % ------ Miscellaneous ------ % @@ -400,7 +400,7 @@ psuserparams /ProcessDSCComment {//.checkprocesscomment exec} put } { .where } ifelse -} bind put +} .internalbind put % ------ Virtual memory ------ % @@ -434,7 +434,7 @@ psuserparams /ProcessDSCComment {//.checkprocesscomment exec} put {pop /vmreclaim load $error /errorname get signalerror} {pop} ifelse } ifelse -} .bind executeonly odef +} .forcebind odef -1 setvmthreshold % ------ IODevices ------ % @@ -486,13 +486,13 @@ end % serverdict pop serverdict /.jobsave save put serverdict /.jobsavelevel 1 put - .userdict /quit { stop } .bind put % CET 28-10 requires a procedure + .userdict /quit { stop } .forcebind put % CET 28-10 requires a procedure } ifelse % Reset the interpreter state. clear cleardictstack initgraphics //false setglobal -} bind executeonly def +} .internalbind def /.startjob { % <exit_bool> <password> <finish_proc> % .startjob <ok_bool> vmstatus pop pop serverdict /.jobsavelevel get eq @@ -521,7 +521,7 @@ systemdict begin { end //quit } { /quit .systemvar /invalidaccess /signalerror load end exec } ifelse -} bind odef +} .internalbind odef end % We would like to define exitserver as a procedure, using the code @@ -536,7 +536,7 @@ serverdict begin //true exch { .startnewjob } .startjob not { /exitserver cvx /invalidaccess signalerror } if -} bind def +} .internalbind def end % serverdict @@ -548,7 +548,7 @@ end % serverdict % We don't bother with many of these yet. % convenience function to make a dictionary from an object and a key -/.pair2dict { exch mark 3 1 roll .dicttomark } bind def +/.pair2dict { exch mark 3 1 roll .dicttomark } .internalbind def currentglobal //false setglobal 25 dict exch setglobal begin currentsystemparams @@ -558,28 +558,28 @@ currentsystemparams % Also define /buildtime in systemdict because Adobe does so and some fonts use it as ID systemdict /buildtime dup load put /byteorder 1 index /ByteOrder get def -/checkpassword { .checkpassword 0 gt } bind def +/checkpassword { .checkpassword 0 gt } .internalbind def dup /DoStartPage known - { /dostartpage { /DoStartPage getsystemparam } bind def - /setdostartpage { /DoStartPage //.pair2dict exec setsystemparams } bind def + { /dostartpage { /DoStartPage getsystemparam } .internalbind def + /setdostartpage { /DoStartPage //.pair2dict exec setsystemparams } .internalbind def } if dup /StartupMode known - { /dosysstart { /StartupMode getsystemparam 0 ne } bind def - /setdosysstart { { 1 } { 0 } ifelse /StartupMode //.pair2dict exec setsystemparams } bind def + { /dosysstart { /StartupMode getsystemparam 0 ne } .internalbind def + /setdosysstart { { 1 } { 0 } ifelse /StartupMode //.pair2dict exec setsystemparams } .internalbind def } if %****** Setting jobname is supposed to set userparams.JobName, too. -/jobname { /JobName getuserparam } bind def -/jobtimeout { /JobTimeout getuserparam } bind def -/ramsize { /RamSize getsystemparam } bind def +/jobname { /JobName getuserparam } .internalbind def +/jobtimeout { /JobTimeout getuserparam } .internalbind def +/ramsize { /RamSize getsystemparam } .internalbind def /realformat 1 index /RealFormat get def dup /PrinterName known - { /setprintername { /PrinterName //.pair2dict exec setsystemparams } bind def + { /setprintername { /PrinterName //.pair2dict exec setsystemparams } .internalbind def } if /printername { currentsystemparams /PrinterName .knownget not { () } if exch copy - } bind def + } .internalbind def currentuserparams /WaitTimeout known - { /waittimeout { /WaitTimeout getuserparam } bind def + { /waittimeout { /WaitTimeout getuserparam } .internalbind def } if % The following do require setpagedevice. @@ -589,37 +589,37 @@ currentuserparams /WaitTimeout known /JobTimeout .knownget not { 0 } if exch /WaitTimeout .knownget not { 0 } if currentpagedevice /ManualFeedTimeout .knownget not { 0 } if - } bind def + } .internalbind def /margins { currentpagedevice /Margins .knownget { exch } { [0 0] } ifelse - } bind def + } .internalbind def /pagemargin { currentpagedevice /PageOffset .knownget { 0 get } { 0 } ifelse - } bind def + } .internalbind def /pageparams { currentpagedevice dup /Orientation .knownget { 1 and ORIENT1 { 1 xor } if } { 0 } ifelse exch dup /PageSize get aload pop 3 index 0 ne { exch } if 3 2 roll /PageOffset .knownget { 0 get } { 0 } ifelse 4 -1 roll - } bind def + } .internalbind def /setdefaulttimeouts { exch mark /ManualFeedTimeout 3 -1 roll /Policies mark /ManualFeedTimeout 1 .dicttomark .dicttomark setpagedevice /WaitTimeout exch mark /JobTimeout 5 2 roll .dicttomark setsystemparams - } bind def -/setduplexmode { /Duplex //.pair2dict exec setpagedevice } bind def + } .internalbind def +/setduplexmode { /Duplex //.pair2dict exec setpagedevice } .internalbind def /setmargins { exch 2 array astore /Margins //.pair2dict exec setpagedevice - } bind def -/setpagemargin { 0 2 array astore /PageOffset //.pair2dict exec setpagedevice } bind def + } .internalbind def +/setpagemargin { 0 2 array astore /PageOffset //.pair2dict exec setpagedevice } .internalbind def /setpageparams { mark /PageSize 6 -2 roll 4 index 1 and ORIENT1 { 1 } { 0 } ifelse ne { exch } if 2 array astore /Orientation 5 -1 roll ORIENT1 { 1 xor } if /PageOffset counttomark 2 add -1 roll 0 2 array astore .dicttomark setpagedevice - } bind def + } .internalbind def /setresolution { count 1 lt { /setresolution cvx /stackunderflow signalerror } if dup type dup /integertype eq exch /realtype eq or not @@ -629,7 +629,7 @@ currentuserparams /WaitTimeout known dup 2 array astore /HWResolution //.pair2dict exec { setpagedevice } stopped { pop /setresolution cvx $error /errorname get signalerror } if - } bind def + } .internalbind def %END PAGEDEVICE % The following are not implemented yet. @@ -780,15 +780,15 @@ end } { pop /none } ifelse -} bind def +} .internalbind def /GetHalftoneName { % - GetHalftoneName <name> currenthalftone /HalftoneName .knownget not { /none } if -} bind def +} .internalbind def /GetSubstituteCRD { % <intentname> GetSubstituteCRD <crdname> pop /DefaultColorRendering -} bind def +} .internalbind def end % The resource machinery hasn't been activated, so just save the ProcSet @@ -819,13 +819,13 @@ end //.renderingintentdict exch .knownget { .setrenderingintent } if } if dup .buildcolorrendering1 .setcolorrendering1 -} .bind put +} .forcebind put % Note: the value 101 in the next line must be the same as the value of % GX_DEVICE_CRD1_TYPE in gscrdp.h. .colorrenderingtypes 101 { dup .builddevicecolorrendering1 .setdevicecolorrendering1 -} .bind put +} .forcebind put % sRGB output CRD, D65 white point mark @@ -868,7 +868,7 @@ mark mark /DecodeLMN [ { dup 0.03928 le { 12.92321 div } { 0.055 add 1.055 div 2.4 exp } ifelse - } bind dup dup ] readonly + } .internalbind dup dup ] readonly /MatrixLMN [ 0.412457 0.212673 0.019334 0.357576 0.715152 0.119192 @@ -996,7 +996,7 @@ mark }ifelse } {exec} ifelse -} .bind odef % must bind .forceput +} .forcebind odef % must .internalbind .forceput /.formtypes 5 dict dup 1 /.execform1 load put @@ -1072,10 +1072,10 @@ def % the values given into an array. This is consistent with what we see when % testing with Adobe Distiller 6.0. % <cyan> <magenta> <yellow> <black> <key> findcmykcustomcolor <array> -/findcmykcustomcolor { 5 array astore } bind executeonly def +/findcmykcustomcolor { 5 array astore } .internalbind def % The following isn't documented by Adobe, but was found in Adobe Illustrator (R) % Version 7.0 Full Prolog -/findrgbcustomcolor { 4 array astore } bind executeonly def +/findrgbcustomcolor { 4 array astore } .internalbind def % Build a tint transform function for use by setcustomcolor. This function % is for a Separation color space which has either a DeviceCMYK base color space @@ -1104,7 +1104,7 @@ def ] } ifelse cvx bind exch pop % Make executable and remove the input array -} bind executeonly def +} .internalbind def % Construct the colorspace array to be used by setcolorspace from the array % result of either findcmykcustomcolor or findrgbcustomcolor. @@ -1124,7 +1124,7 @@ def ] } ifelse exch pop % remove the input array -} bind executeonly def +} .internalbind def % Set a custom color based upon a tint and array which describes the custom % color. See findcmykcustomcolor. First we create and then set a Separation @@ -1178,7 +1178,7 @@ def setcolorspace % Set the Separation color space as current setcolor % Set the tint as the current color } ifelse -} bind executeonly def +} .internalbind def % This proc is supposed to implement a version of overprinting. TN 5044 says % that this proc is not used by any shipping host-based application. We have @@ -1189,9 +1189,9 @@ def % to 0. /setcmykoverprint { 4 { dup -1 eq { pop 0 } if 4 1 roll } repeat setcmykcolor -} bind def +} .internalbind def -/separation_all [/Separation /All /DeviceCMYK { dup dup dup } bind ] readonly def +/separation_all [/Separation /All /DeviceCMYK { dup dup dup } .internalbind ] readonly def % Collect the arguments into the image dictionary % <width> <height> <bits/sample> <matrix> <proc> args2dict <dict> @@ -1201,14 +1201,14 @@ def { /ImageType /Decode /DataSource /ImageMatrix /BitsPerComponent /Height /Width } { exch def } forall currentdict end -} bind def +} .internalbind def % Prints (1-gray) on all separations. % <gray> setseparationgray - /setseparationgray { //separation_all setcolorspace 1 exch sub setcolor -} bind def +} .internalbind def % Renders an image whose sample values specify the amount of the custom color. % <width> <height> <bits/sample> <matrix> <proc> <array> customcolorimage - @@ -1217,7 +1217,7 @@ def //buildcolorspacearray exec setcolorspace //args2dict exec image grestore -} bind def +} .internalbind def % Renders an image on all process and custom color plates. % <width> <height> <bits/sample> <matrix> <proc> @@ -1226,7 +1226,7 @@ def //separation_all setcolorspace //args2dict exec image grestore -} bind def +} .internalbind def { /buildcustomtinttransform /buildcolorspacearray /separation_all /args2dict } { currentdict exch undef } forall diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps b/Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps index 8da9d41501c..ca27d9be92e 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2023 Artifex Software, Inc. +% Copyright (C) 2001-2024 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -110,7 +110,7 @@ currentdict /.bind_ undef 3 index read not { pop exch not exch exit } if 3 copy put pop pop } for 3 -1 roll pop exch -} bind def +} .internalbind def /.bigstring { % <size> .bigstring <string|bytestring> count 1 lt { /.bigstring cvx /stackunderflow signalerror } if @@ -118,7 +118,7 @@ currentdict /.bind_ undef /.bigstring cvx /typecheck signalerror } if dup 65400 gt { .bytestring } { string } ifelse -} bind def +} .internalbind def % ------ HalftoneTypes 6, 10, 16 and HalftoneMode ------ % @@ -163,7 +163,7 @@ currentdict /.bind_ undef } if mark /HalftoneType 5 /Default currentdict end .dicttomark { .sethalftone5 } -} bind def +} .internalbind def /.sethalftone6 { % <dict> <dict> .sethalftone6 <setdict> <dict5> % { .sethalftone5 } @@ -171,7 +171,7 @@ currentdict /.bind_ undef dup /Thresholds get 1 index /Width get 2 index /Height get //null 8 //.makehalftone7 exec -} bind def +} .internalbind def /.sethalftone10 { % <dict> <dict> .sethalftone10 <setdict> <dict5> % { .sethalftone5 } @@ -181,7 +181,7 @@ currentdict /.bind_ undef dup /Thresholds get dup type /stringtype eq { 0 () .subfiledecode } if 1 index /Xsquare get dup 3 index /Ysquare get dup 8 //.makehalftone7 exec -} bind def +} .internalbind def /.sethalftone16 { % <dict> <dict> .sethalftone16 <setdict> <dict5> % { .sethalftone5 } @@ -194,7 +194,7 @@ currentdict /.bind_ undef } { % 1-rectangle case //null } ifelse 16 //.makehalftone7 exec -} bind def +} .internalbind def .halftonetypes begin 6 //.sethalftone6 def @@ -208,9 +208,12 @@ end //setcolorscreen } { 12 { pop } repeat //.getdefaulthalftone exec + currentglobal + true setglobal { //sethalftone } { .setdefaulthalftone } ifelse + setglobal } ifelse } odef /setscreen { @@ -218,20 +221,26 @@ end //setscreen } { pop pop pop //.getdefaulthalftone exec + currentglobal + true setglobal { //sethalftone } { .setdefaulthalftone } ifelse + setglobal } ifelse } odef /sethalftone { /HalftoneMode getuserparam 0 eq { //sethalftone } { - gsave //sethalftone grestore + pop + currentglobal + true setglobal //.getdefaulthalftone exec { //sethalftone } { .setdefaulthalftone } ifelse + setglobal } ifelse } odef @@ -248,7 +257,7 @@ end exch dup % /name <<sub-image>> <<image>> <<image>> 4 2 roll % <<image>> <<image>> /name <<sub-image>> put % <<image>> -} bind def +} .internalbind def % Copy mask data source to a reusable stream % <dict> <source> buffer_mask <dict> <file> @@ -258,7 +267,7 @@ end 1 index /BitsPerComponent get mul 7 add 8 idiv exch /Height get mul () /SubFileDecode filter /ReusableStreamDecode filter -} bind def +} .internalbind def % Data type vs. mask type decission table. % All procedures have the signature: @@ -284,14 +293,14 @@ end 1 array astore cvx 0 () /SubFileDecode filter } ifelse /DataDict //update_image3 exec - } bind + } .internalbind .dicttomark readonly /arraytype mark % data is a proc /stringtype { % convert mask to proc exch pop 1 array astore cvx /MaskDict //update_image3 exec - } bind + } .internalbind /arraytype { % buffer mask in reusable stream and convert back to proc exch pop //buffer_mask exec @@ -299,7 +308,7 @@ end { readstring pop } aload pop 4 packedarray cvx /MaskDict //update_image3 exec - } bind + } .internalbind /packedarraytype 1 index /filetype 1 index .dicttomark readonly @@ -309,12 +318,12 @@ end exch pop 1 array astore cvx 0 () /SubFileDecode filter /MaskDict //update_image3 exec - } bind + } .internalbind /arraytype { % buffer the mask and convert to file exch pop //buffer_mask exec /MaskDict //update_image3 exec - } bind + } .internalbind /packedarraytype 1 index /filetype { //systemdict /userdict get /PDFTopSave known { @@ -324,7 +333,7 @@ end //buffer_mask exec /MaskDict //update_image3 exec } ifelse - } bind + } .internalbind .dicttomark readonly .dicttomark readonly def @@ -352,7 +361,7 @@ end } ifelse } if .image3 - } bind put + } .internalbind put dup 4 /.image4 load put % We also detect ImageType 103 here: it isn't worth making a separate file % just for this. @@ -443,7 +452,7 @@ systemdict /.reuseparamdict mark /$error .systemvar /errorinfo [ /ColorSpace //null ] put /shfill .systemvar /undefined signalerror } ifelse -} bind def +} .internalbind def /.buildshading_and_shfill { //.buildshading exec .shfill @@ -464,7 +473,7 @@ systemdict /.reuseparamdict undef } if .buildshadingpattern 3 -1 roll pop counttomark 1 add 2 roll setcolorspace setcolor pop -} bind def +} .internalbind def .patterntypes 2 //.buildpattern2 put diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_pdfwr.ps b/Master/tlpkg/tlgs/Resource/Init/gs_pdfwr.ps index 9a165719fe3..68d14e2feb6 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_pdfwr.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_pdfwr.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2023 Artifex Software, Inc. +% Copyright (C) 2001-2024 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -23,8 +23,9 @@ % These correspond to the 4 predefined settings in Acrobat Distiller 5, % plus a "default" setting that doesn't downsample images. +mark { /pdfwrite finddevice pop } .internalstopped -{pop pop (%END PDFWR) .skipeof} if +{cleartomark (%END PDFWR) .skipeof} {cleartomark} ifelse languagelevel 2 .setlanguagelevel @@ -333,7 +334,7 @@ languagelevel 2 .setlanguagelevel } loop pop pop pop } ifelse -} bind def +} .internalbind def % Encode values to pass for the /pdfmark or /DSC pseudo-parameter. /.pdf===dict mark @@ -345,7 +346,7 @@ languagelevel 2 .setlanguagelevel 1 index exch pdf===only ( ) } forall pop exch writestring - } bind + } .internalbind /packedarraytype 1 index /dicttype { 1 index (<<\n) writestring @@ -353,7 +354,7 @@ languagelevel 2 .setlanguagelevel 1 index exch pdf===only dup (\n) writestring } forall (>>) writestring - } bind + } .internalbind /nametype { % If the name string includes any non-regular characters, % write it with two preceding and one following null character(s). @@ -373,7 +374,7 @@ languagelevel 2 .setlanguagelevel } { write===only } ifelse - } bind + } .internalbind /realtype { % Prevent using floating point format - see Bug 688167. dup dup 0 lt { neg } if 0.01 lt { @@ -388,11 +389,11 @@ languagelevel 2 .setlanguagelevel } { write===only } ifelse - } bind + } .internalbind .dicttomark readonly def /pdf===only { % <file> <obj> pdf===only - .pdf===dict 1 index type .knownget { exec } { write===only } ifelse -} bind def +} .internalbind def /.pdfcvbuf 30 string def % enough for most arguments userdict /.pdfcvstring () put /.pdfcvs { % <obj> .pdfcvs <string> @@ -405,7 +406,7 @@ userdict /.pdfcvstring () put } /NullEncode filter dup 3 -1 roll pdf===only closefile .setglobal .pdfcvstring -} bind def +} .internalbind def % Redefine pdfmark to pass the data to the driver. % We use a pseudo-parameter named /pdfmark whose value is an array: @@ -414,7 +415,7 @@ userdict /.pdfcvstring () put currentdevice //null //false counttomark 1 add 3 roll % Don't allow the page device to get cleared.... {.putdeviceparams} .currentpagedevice pop {.setpagedevice} 3 .execn -} bind def +} .internalbind def % Convert relevant operands to strings in an array. /.pdfcvsloop { % -mark- values ... markname start step .pdfcvsloop % [values ... ctm markname] @@ -424,20 +425,20 @@ userdict /.pdfcvstring () put 3 1 roll % Stack: values start step 2 index length 3 sub { 2 copy 2 copy get .pdfcvs put pop } for -} bind def +} .internalbind def /.pdfcvsall { % -mark- values ... markname .pdfcvsall <<same>> 0 1 .pdfcvsloop -} bind def +} .internalbind def /.pdfcvseven { % -mark- key value ... markname .pdfcvseven <<same>> 1 2 .pdfcvsloop -} bind def +} .internalbind def /.pdfcvsnone { % -mark- values ... markname .pdfcvsnone <<same>> 100000 1 .pdfcvsloop -} bind def +} .internalbind def /.pdfcvsfirst { % -mark- first values ... markname .pdfcvsfirst<<same>> .pdfcvsnone dup 0 2 copy get .pdfcvs put -} bind def +} .internalbind def % The procedures in the following dictionary are called with the entire % pdfmark operand list (including the pdfmark name) on the stack; % they may modify this ad lib. They must call .pdfcvsxxx. @@ -461,16 +462,16 @@ userdict /.pdfcvstring () put } { .pdfcvsall } ifelse - } bind + } .internalbind % Unpack the array for PUTINTERVAL. /PUTINTERVAL { pop aload pop /.PUTINTERVAL .pdfcvsall - } bind + } .internalbind .dicttomark readonly def /.pdfparamerror { % ? ? ? -mark- ... <errname> <opname> .pdfparamerror - counttomark 4 add 2 roll cleartomark pop pop pop .systemvar exch signalerror -} bind def +} .internalbind def /.CountLeafs { 0 exch @@ -496,7 +497,7 @@ userdict /.pdfcvstring () put pop pop 0 exit } ifelse } forall -} bind def +} .internalbind def /.ExtractLeafs { @@ -521,7 +522,7 @@ userdict /.pdfcvstring () put } if } ifelse } forall -} bind def +} .internalbind def /.pdfpagelabels { dup type /dicttype eq { @@ -571,7 +572,7 @@ userdict /.pdfcvstring () put }{ /pdfpagelabels .pdfparamerror } ifelse -} bind def +} .internalbind def /pdfmark { % -mark- <key> <value> ... <markname> pdfmark - counttomark 0 eq { @@ -643,7 +644,7 @@ currentdict /.pdfmarkparams .undef } { resourcestatus } ifelse - } bind .makeoperator .forceput + } .internalbind .makeoperator .forceput systemdict /.pdf_hooked_DSC_Creator //true .forceput } executeonly if pop @@ -655,7 +656,7 @@ currentdict /.pdfmarkparams .undef { pop } ifelse -} .bind executeonly odef % must be bound and hidden for .forceput +} .forcebind odef % must be bound and hidden for .forceput % Use the DSC processing hook to pass DSC comments to the driver. % We use a pseudo-parameter named DSC whose value is an array: @@ -686,7 +687,7 @@ currentdict /.pdfmarkparams .undef } { pop pop pop } ifelse -} bind def +} .internalbind def currentdict /.pdf_hook_DSC_Creator undef /.initialize_dsc_parser where { pop @@ -719,7 +720,7 @@ currentdict /.pdf_hook_DSC_Creator undef << /ProcessDSCComment 3 -1 roll >> setuserparams setglobal } if - } bind .schedule_init + } .internalbind .schedule_init } if % ---------------- {set,current}distillerparams ---------------- % @@ -864,7 +865,7 @@ currentdict /.pdf_hook_DSC_Creator undef { currentdevice } { /pdfwrite finddevice } ifelse - } bind def + } .internalbind def % Some badly designed PostScript files only expect the current/set % distillerparams operators to exist in a distiller. Since we have @@ -902,7 +903,7 @@ currentdict /.pdf_hook_DSC_Creator undef /setdistillerparams cvx /undefined signalerror } if .setdistillerparams -} bind odef +} .internalbind odef /currentdistillerparams { % Check to see if the current device is a Distiller /IsDistiller /GetDeviceParam .special_op { @@ -914,7 +915,7 @@ currentdict /.pdf_hook_DSC_Creator undef /currentdistillerparams cvx /undefined signalerror } if .currentdistillerparams -} bind odef +} .internalbind odef % Patch 'where' so that the distiller operators are only visible % if the pdfwrite device is the current one. @@ -930,7 +931,7 @@ currentdict /.pdf_hook_DSC_Creator undef } { .where pop dup //systemdict eq { pop //false } { //true } ifelse } ifelse -} bind +} .internalbind { /currentdistillerparams /setdistillerparams /pdfmark } { .wheredict exch 2 index put } forall pop @@ -954,7 +955,7 @@ currentdict /.pdf_hook_DSC_Creator undef } { known } ifelse -} .bind odef +} .forcebind odef % Create a table for translation DSC comments into Unicode UTF-16 /.make_DSC_translation_table { % <encoding> .make_DSC_translation_table <array> @@ -985,7 +986,7 @@ currentdict /.pdf_hook_DSC_Creator undef 3 1 roll put % [out] [in] } for pop % [out] -} bind def +} .internalbind def 1000 % priority { @@ -1000,20 +1001,18 @@ currentdict /.pdf_hook_DSC_Creator undef systemdict /ProvideUnicode .knownget not { //false } if or { currentglobal //true setglobal - systemdict /.setupUnicodeDecoder known { - /Unicode /Decoding resourcestatus { - pop pop - /Unicode /Decoding findresource - .setupUnicodeDecoder - } { - QUIET not { - (WARNING: /Unicode /Decoding resource is not accessible but it is useful for generating ToUnicode CMap.) = - } if - } ifelse - } if + /Unicode /Decoding resourcestatus { + pop pop + /Unicode /Decoding findresource + .setupUnicodeDecoder + } { + QUIET not { + (WARNING: /Unicode /Decoding resource is not accessible but it is useful for generating ToUnicode CMap.) = + } if + } ifelse setglobal } if -} bind .schedule_init +} .internalbind .schedule_init 1010 % priority { @@ -1056,7 +1055,7 @@ currentdict /.pdf_hook_DSC_Creator undef currentdict end .setdistillerparams .distillerdevice //null //false mark .putdeviceparams dup type /booleantype eq not { cleartomark pop } if pop pop -} bind .schedule_init +} .internalbind .schedule_init 2000 % priority { % Note, this may not work if the initial device is not pdfwrite @@ -1067,7 +1066,7 @@ currentdict /.pdf_hook_DSC_Creator undef % Inform the device with initial graphic state. See gdev_pdf_fill_path. newpath fill } if -} bind .schedule_init +} .internalbind .schedule_init .setlanguagelevel diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_res.ps b/Master/tlpkg/tlgs/Resource/Init/gs_res.ps index 4fa65c386ab..0b5c9de46a6 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_res.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_res.ps @@ -103,7 +103,7 @@ setglobal /.findcategory { % <name> .findcategory - % (pushes the category on the dstack) /Category .findresource begin % note: *not* findresource -} bind def +} .internalbind def % If an error occurs within the logic of a resource operator (after operand % acquisition and checking), the Adobe interpreters report the operator name, @@ -119,12 +119,12 @@ setglobal /.undefinedresource { % <command> .undefinedresource - /Category dup load eq { /undefined } { /undefinedresource } ifelse signaloperror -} bind def +} .internalbind def /.resourceexec { % <key> /xxxResource .resourceexec - % (also pops the category from the dstack) load exec end -} bind def +} .internalbind def % .getvminstance treats instances on disk as undefined. /.getvminstance { % <key> .getvminstance <instance> -true- @@ -134,7 +134,7 @@ setglobal } { //false } ifelse -} bind def +} .internalbind def 20 dict begin @@ -155,10 +155,10 @@ setglobal }{ /defineresource cvx /typecheck signaloperror } ifelse -} bind executeonly odef +} .internalbind odef /FindResource % (redefined below) { .Instances exch get 0 get - } bind executeonly def + } .internalbind def % Additional entries @@ -168,7 +168,7 @@ setglobal /.LocalInstances 0 dict def /.GetInstance { .Instances exch .knownget - } bind def + } .internalbind def /.CheckResource { dup gcheck currentglobal and { /DefineResource /FindResource /ResourceForAll /ResourceStatus @@ -177,7 +177,7 @@ setglobal forall not { /defineresource cvx /invalidaccess signaloperror } if //true - } bind def + } .internalbind def .Instances end begin % for the base case of findresource @@ -198,7 +198,7 @@ setglobal 2 copy dup /Category eq { pop //Category 0 get begin } { //.findcategory exec } ifelse /FindResource //.resourceexec exec exch pop exch pop -} bind +} .internalbind end % .Instances of Category def /findresource { @@ -210,7 +210,7 @@ def /findresource .systemvar /typecheck signalerror } if /findresource cvx //.findresource .errorexec -} bind executeonly odef +} .internalbind odef /defineresource { % <key> <instance> <category> defineresource <instance> 2 .argindex 2 index 2 index % catch stackunderflow @@ -226,7 +226,7 @@ def /DefineResource //.resourceexec exec 4 1 roll pop pop pop } .errorexec -} bind executeonly odef +} .internalbind odef % We must prevent resourceforall from automatically restoring the stacks, % because we don't want the stacks restored if proc causes an error or % executes a 'stop'. On the other hand, resourceforall is defined in the @@ -240,10 +240,10 @@ def % Stack: <template> <proc> <scratch> <category> proc exch pop % pop the category exec end -} .bind executeonly def +} .forcebind def /resourceforall { % <template> <proc> <scratch> <category> resourceforall1 - //resourceforall1 exec % see above -} .bind executeonly odef +} .forcebind odef /resourcestatus { % <key> <category> resourcestatus <status> <size> true % <key> <category> resourcestatus false { @@ -259,7 +259,7 @@ def % for error reporting. CET 23-26 /resourcestatus cvx $error /errorname get signalerror } if -} .bind executeonly odef +} .forcebind odef /undefineresource { % <key> <category> undefineresource - 0 .argindex type /nametype ne { /undefinedresource cvx /typecheck signaloperror @@ -272,7 +272,7 @@ def % here but uses operator for the errors above. CET 23-33 /undefineresource cvx $error /errorname get signalerror } if -} .bind executeonly odef +} .forcebind odef % Define the system parameters used for the Generic implementation of % ResourceFileName. @@ -293,7 +293,7 @@ systemdict begin } ifelse } ifelse } forall -} bind def +} .internalbind def % <path> <name> <string> .resource_dir_name <path> <name> <string> /.resource_dir_name @@ -310,7 +310,7 @@ systemdict begin /.default_resource_dir cvx /configurationerror signalerror } if } ifelse -} bind def +} .internalbind def currentdict /pssystemparams known not { /pssystemparams 10 dict readonly def @@ -364,7 +364,7 @@ status { /.rfnstring 8192 string def /.genericrfn % <key> <scratch> <prefix> .genericrfn <filename> { 3 -1 roll //.rfnstring cvs concatstrings exch copy - } bind def + } .internalbind def % Define the Generic category. @@ -385,11 +385,11 @@ status { % Use .setstackprotect to prevent the stacks from being restored if % an error occurs during execution of proc. 1 get //false .setstackprotect exec //true .setstackprotect -} bind def +} .internalbind def /.localresourceforall { % <key> <value> <args> .localr'forall - exch pop 2 copy 0 get .stringmatch { //.enumerateresource exec } { pop pop } ifelse -} bind def +} .internalbind def /.globalresourceforall { % <key> <value> <args> .globalr'forall - exch pop 2 copy 0 get .stringmatch { @@ -401,7 +401,7 @@ status { } { pop pop } ifelse -} bind def +} .internalbind def /.externalresourceforall { % <filename> <len> <args> .externalr'forall - 3 1 roll 1 index length 1 index sub getinterval exch dup 3 get begin .Instances .LocalInstances end @@ -411,7 +411,7 @@ status { } { 2 index known { pop pop } { //.enumerateresource exec } ifelse } ifelse -} bind def +} .internalbind def /DefineResource dup { .CheckResource @@ -442,7 +442,7 @@ status { { /defineresource cvx /typecheck signaloperror } ifelse -} .bind executeonly .makeoperator % executeonly to prevent access to .forceput +} .forcebind .makeoperator % executeonly to prevent access to .forceput /UndefineResource { { dup 2 index .knownget { dup 1 get 1 ge @@ -458,7 +458,7 @@ status { { 2 copy .Instances exch exec } if .LocalInstances exch exec - } .bind executeonly + } .forcebind % Because of some badly designed code in Adobe's CID font downloader that % makes findresource and resourcestatus deliberately inconsistent with each % other, the default FindResource must not call ResourceStatus if there is @@ -484,7 +484,7 @@ status { /findresource cvx //.undefinedresource exec } ifelse } ifelse -} .bind executeonly +} .forcebind % Because of some badly designed code in Adobe's CID font downloader, the % definition of ResourceStatus for Generic and Font must be the same (!). % We patch around this by using an intermediate .ResourceFileStatus procedure. @@ -494,10 +494,10 @@ status { } { .ResourceFileStatus } ifelse -} .bind executeonly +} .forcebind /.ResourceFileStatus { .ResourceFile { closefile 2 -1 //true } { pop //false } ifelse -} bind executeonly +} .internalbind /ResourceForAll { % Construct a new procedure to hold the arguments. % All objects constructed here must be in local VM to avoid @@ -555,7 +555,7 @@ status { 3 2 roll pop % args { forall } 0 get currentdict end 2 .execn begin -} .bind executeonly +} .forcebind /ResourceFileName { % /in (scr) --> (p/c/n) exch //.rfnstring cvs % (scr) (n) @@ -587,7 +587,7 @@ status { ifelse } ifelse exch copy % (p/c/n) -} .bind executeonly +} .forcebind % Additional entries @@ -601,7 +601,7 @@ status { /.LocalInstances { localinstancedict Category .knownget not { //.emptydict } if - } bind + } .internalbind /.GetInstance { currentglobal { .Instances exch .knownget } @@ -611,10 +611,10 @@ status { ifelse } ifelse - } bind + } .internalbind /.CheckResource { //true - } bind + } .internalbind /.vmused { % - .vmused <usedvalue> % usedvalue = vmstatus in global + vmstatus in local. @@ -622,7 +622,7 @@ status { .currentglobal not .setglobal vmstatus pop exch pop add } repeat -} bind executeonly odef +} .internalbind odef /.DoLoadResource { % .LoadResource may push entries on the operand stack. % It is an undocumented feature of Adobe implementations, @@ -641,7 +641,7 @@ status { 2 3 -1 roll put % Stack: ... count key exch count 1 sub exch sub {exch pop} repeat -} bind +} .internalbind /.LoadResource { dup .ResourceFile { exch pop currentglobal @@ -652,7 +652,7 @@ status { { dup //.undefinedresource exec } ifelse - } bind + } .internalbind /.ResourceFile { Category //.rfnstring cvs length % key l @@ -681,7 +681,7 @@ status { pop //false } ifelse } ifelse - } bind + } .internalbind .dicttomark /Category defineresource pop @@ -704,7 +704,7 @@ mark /ColorSpaceFamily { } % These must be deferred, because optional features may add some. /Emulator - mark EMULATORS { <00> search { exch pop cvn exch }{ cvn exit } ifelse } .bind loop //.packtomark exec + mark EMULATORS { <00> search { exch pop cvn exch }{ cvn exit } ifelse } .forcebind loop //.packtomark exec /Filter { } % These must be deferred, because optional features may add some. /IODevice @@ -753,17 +753,17 @@ counttomark 2 idiv ifelse } ifelse - } bind executeonly + } .internalbind /UndefineResource - { /undefineresource cvx /invalidaccess signaloperror } bind executeonly + { /undefineresource cvx /invalidaccess signaloperror } .internalbind /FindResource { .Instances 1 index .knownget { exch pop } { /findresource cvx //.undefinedresource exec } ifelse - } bind executeonly + } .internalbind /ResourceStatus - { .Instances exch known { 0 0 //true } { //false } ifelse } bind executeonly + { .Instances exch known { 0 0 //true } { //false } ifelse } .internalbind /ResourceForAll /Generic //.findcategory exec /ResourceForAll load end @@ -790,7 +790,7 @@ counttomark 2 idiv dict .copydict begin counttomark 2 idiv { def } repeat pop % pop the mark currentdict end /Category defineresource pop - } bind def + } .internalbind def /ColorRendering mark /InstanceType /dicttype .definecategory % ColorSpace is defined below @@ -844,10 +844,10 @@ pop pop % The "hooks" are no-ops here, redefined in LL3. /.definedefaultcs { % <index> <value> .definedefaultcs - pop pop -} bind def +} .internalbind def /.undefinedefaultcs { % <index> .undefinedefaultcs - pop -} bind def +} .internalbind def /ColorSpace mark @@ -866,7 +866,7 @@ userdict /.localcsdefaults //false put 1 index //.definedefaultcs exec currentglobal not { .userdict /.localcsdefaults //true put } if } if -} bind executeonly +} .internalbind /UndefineResource { dup /Generic /Category findresource /UndefineResource get exec @@ -889,7 +889,7 @@ userdict /.localcsdefaults //false put } { pop } ifelse -} bind executeonly +} .internalbind .definecategory % ColorSpace @@ -904,7 +904,7 @@ userdict /.localcsdefaults //false put /.Instances mark EncodingDirectory - { dup length 256 eq { [ exch readonly 0 -1 ] } { pop [//null 2 -1] } ifelse + {dup length 256 eq { [ exch readonly 0 -1 ] } { pop [//null 2 -1] } ifelse } forall .dicttomark @@ -919,7 +919,7 @@ userdict /.localcsdefaults //false put { exch copy exch pop } { /Generic /Category findresource /ResourceFileName get exec } ifelse - } bind executeonly + } .internalbind .definecategory % Encoding @@ -973,7 +973,7 @@ userdict /.localcsdefaults //false put % Scan a FONTPATH directory and try again. //.scannextfontdir exec not { //false exit } if } loop -} bind def +} .internalbind def /.fontstatus { % <fontname> .fontstatus <fontname> <found> //.fontstatusaux exec @@ -983,7 +983,7 @@ userdict /.localcsdefaults //false put { //.fontstatusaux exec } { //false } ifelse } ifelse -} bind executeonly def +} .internalbind def currentdict /.fontstatusaux .undef /Font mark @@ -993,11 +993,11 @@ currentdict /.fontstatusaux .undef /DefineResource { 2 copy //definefont exch pop /Generic /Category findresource /DefineResource get exec - } bind executeonly + } .internalbind /UndefineResource { dup //undefinefont /Generic /Category findresource /UndefineResource get exec - } bind executeonly + } .internalbind /FindResource { dup //.getvminstance exec { exch pop 0 get @@ -1008,14 +1008,14 @@ currentdict /.fontstatusaux .undef .loadfontresource } ifelse } ifelse -} bind executeonly +} .internalbind /ResourceForAll { { //.scannextfontdir exec not { exit } if } loop /Generic /Category findresource /ResourceForAll get exec -} .bind executeonly +} .forcebind /.ResourceFileStatus { .fontstatus { pop 2 -1 //true } { pop //false } ifelse -} bind executeonly +} .internalbind /.loadfontresource { dup //.vmused exch @@ -1032,7 +1032,7 @@ currentdict /.fontstatusaux .undef } { pop } ifelse exch pop -} bind +} systemdict /CETMODE .knownget not {//false} if {.bind}{.internalbind}ifelse /.Instances FontDirectory length 2 mul dict @@ -1052,26 +1052,26 @@ currentdict /.fontstatusaux .undef } ifelse //.definefontmap exec - } bind def + } .internalbind def /definefont { { /Font defineresource } stopped { /definefont cvx $error /errorname get signalerror } if -} bind executeonly odef +} .internalbind odef /undefinefont { /Font undefineresource -} bind executeonly odef +} .internalbind odef % The Red Book requires that findfont be a procedure, not an operator, % but it still needs to restore the stacks reliably if it fails. /.findfontop { { /Font findresource } stopped { pop /findfont cvx $error /errorname get signalerror } if -} bind executeonly odef +} .internalbind odef /findfont { .findfontop -} bind executeonly def % Must be a procedure, not an operator +} .internalbind def % Must be a procedure, not an operator % Remove initialization utilities. currentdict /.definecategory .undef @@ -1093,9 +1093,9 @@ end % level2dict { /Encoding findresource } stopped { pop /findencoding cvx $error /errorname get signalerror } if - } bind def + } .internalbind def /findencoding /.findencoding load def % must be a procedure - /.defineencoding { /Encoding defineresource pop } bind def + /.defineencoding { /Encoding defineresource pop } .internalbind def % ColorRendering resources and ProcSet systemdict /ColorRendering .knownget { /ColorRendering exch /ProcSet defineresource pop @@ -1158,7 +1158,7 @@ end % level2dict } forall % clean up systemdict /.fixresources undef -} bind def +} .internalbind def %% Replace 1 (gs_resmp.ps) (gs_resmp.ps) dup runlibfile VMDEBUG diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_resmp.ps b/Master/tlpkg/tlgs/Resource/Init/gs_resmp.ps index f5c5b091b56..92c7d62c222 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_resmp.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_resmp.ps @@ -118,7 +118,7 @@ setpacking } ifelse % {precopy} } for % {copy} cvx -} bind def +} .internalbind def //.BindAux 0 //BindWithCurrentdict put % bind the recursive call in 'Bind'. @@ -150,7 +150,7 @@ setpacking /status 0 def % variable for the current status to enumerate - do not bind with it ! end exch setglobal -} bind def +} .internalbind def /execstack_lookup % <object> execstack_lookup <object1> % <object> execstack_lookup null @@ -208,7 +208,7 @@ setpacking } ifelse } for % <object> bGlobal [execstack] bResult exch pop exch setglobal exch pop % bResult -} bind def +} .internalbind def currentpacking //false setpacking /MethodsToRedefine 5 dict begin @@ -383,7 +383,7 @@ currentpacking //false setpacking pop } if RESMPDEBUG { (resmp GetCIDSystemInfoFromMap end) = } if - } bind def + } .bind def currentdict end def setpacking @@ -519,7 +519,7 @@ setpacking CategoryName NewCategory /Category defineresource pop } if end % OptionsDict -} bind executeonly def +} .internalbind def currentdict /PutPreprocessRecord .undef diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps b/Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps index 782f9b23ee4..a8f1c0d10f6 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps @@ -30,23 +30,23 @@ level2dict begin (%gsavepagedevice) cvn { currentpagedevice pop gsave - } bind def + } .internalbind def (%savepagedevice) cvn { currentpagedevice pop save - } bind def + } .internalbind def (%gstatepagedevice) cvn { currentpagedevice pop gstate - } bind def + } .internalbind def (%copygstatepagedevice) cvn { currentpagedevice pop copy - } bind def + } .internalbind def (%currentgstatepagedevice) cvn { currentpagedevice pop currentgstate - } bind def + } .internalbind def % Define interpreter callouts for handling gstate-restoring operators % when the current page device needs to be changed. @@ -140,14 +140,14 @@ level2dict begin ifelse .copydict readonly } ifelse - } bind + } .internalbind /OutputAttributes 1 index /Policies { 3 copy pop .knownget { dup length 2 index length add dict .copydict } { dup length dict } ifelse copy readonly - } bind + } .internalbind .dicttomark readonly def % M. Sweet, Easy Software Products: @@ -261,7 +261,7 @@ NOMEDIAATTRS { ifelse } forall pop - } bind def + } .internalbind def currentdict /.presentspecial .undef @@ -284,7 +284,7 @@ currentdict /.presentspecial .undef /setpagedevice .systemvar /rangecheck signalerror } if 2 array astore - } bind def + } .internalbind def % Try setting the device parameters from the merged request. /.trysetparams % <merged> <(ignored)> <device> <Policies> @@ -298,7 +298,7 @@ currentdict /.presentspecial .undef SETPDDEBUG { (Putting.) = pstack flush } if .putdeviceparamsonly SETPDDEBUG { (Result of putting.) = pstack flush } if - } bind executeonly odef + } .internalbind odef /.installpagedevice { % Since setpagedevice doesn't create new device objects, @@ -326,46 +326,46 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if % A careful reading of the Red Book reveals that an erasepage % should occur, but *not* an initgraphics. erasepage .beginpage - } bind executeonly def + } .internalbind def /.uninstallpagedevice { {2 .endpage { .currentnumcopies //false .outputpage } if} //.internalstopped exec pop nulldevice - } bind executeonly def + } .internalbind def (%grestorepagedevice) cvn { .uninstallpagedevice grestore //.installpagedevice exec - } bind def + } .internalbind def (%grestoreallpagedevice) cvn { .uninstallpagedevice grestore //.installpagedevice exec grestoreall - } bind def + } .internalbind def (%restore1pagedevice) cvn { .uninstallpagedevice grestore //.installpagedevice exec restore - } bind def + } .internalbind def (%restorepagedevice) cvn { .uninstallpagedevice restore //.installpagedevice exec - } bind def + } .internalbind def (%setgstatepagedevice) cvn { .uninstallpagedevice setgstate //.installpagedevice exec - } bind def + } .internalbind def % Redefine .currentpagedevice and .setpagedevice so they convert between % null and a fixed empty directionary. /.nullpagedevice 0 dict readonly def /.currentpagedevice { //.currentpagedevice exch dup //null eq { pop //.nullpagedevice } if exch -} bind odef +} .internalbind odef /.setpagedevice { dup //.nullpagedevice eq { pop //null } if //.setpagedevice -} bind odef +} .internalbind odef % ---------------- Auxiliary definitions ---------------- % @@ -394,7 +394,7 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if } if pop - } bind + } .internalbind .dicttomark readonly def % Note that the values of .requiredattrs are executed, not just fetched. /.requiredattrs mark @@ -443,9 +443,9 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if mark 0 mark .dicttomark readonly .dicttomark } (%MediaDestination) 0 - /Install {{.callinstall}} bind - /BeginPage {{.callbeginpage}} bind - /EndPage {{.callendpage}} bind + /Install {{.callinstall}} .internalbind + /BeginPage {{.callbeginpage}} .internalbind + /EndPage {{.callendpage}} .internalbind /Policies .defaultpolicies /ImagingBBox //null % default value /UseCIEColor /.getuseciecolor load @@ -490,7 +490,7 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if % makes the dictionary read only .writeonlykeys {2 index exch undef pop} forall dup .setpagedevice -} bind def +} .internalbind def % Copy a dictionary recursively. /.copytree { % <dict> .copytree <dict'> @@ -568,12 +568,12 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if readonly } ifelse } if -} bind odef +} .internalbind odef % Define access to device defaults. /.defaultdeviceparams { finddevice //null .getdeviceparams - } bind def + } .internalbind def % Select media (input or output). The hard work is done in an operator: % <pagedict> <attrdict> <policydict> <keys> .matchmedia <key> true @@ -606,7 +606,7 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if forall } ifelse - } bind def + } .internalbind def % Apply Policies to any unprocessed failed requests. % As we process each request entry, we replace the error name @@ -629,7 +629,7 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if cleartomark /setpagedevice .systemvar /configurationerror signalerror } ifelse -} bind executeonly odef +} .internalbind odef % Making this an operator means we can properly hide % the contents - specifically .forceput @@ -642,14 +642,14 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if { 4 index 3 1 roll .forceput } executeonly { 3 index exch .undef } ifelse -} bind executeonly odef +} .internalbind odef /7Policy { % For PageSize only, just impose the request. 1 index /PageSize eq { pop pop 1 index /PageSize 7 put } { .policyprocs 0 get exec } ifelse -} bind executeonly odef +} .internalbind odef /.applypolicies % <orig> <merged> <failed> .applypolicies % <orig> <merged'> <failed'> @@ -674,7 +674,7 @@ SETPDDEBUG { (Result of putting.) = pstack flush } if } ifelse } forall pop -} .bind executeonly odef +} .forcebind odef currentdict /0Policy undef currentdict /1Policy undef @@ -695,7 +695,7 @@ currentdict /7Policy undef { pop .putdeviceparams } ifelse - } bind def + } .internalbind def /.postinstall { % mark ... <failed> <merged> .postinstall - @@ -1003,7 +1003,7 @@ SETPDDEBUG { (Installing.) = pstack flush } if //.postinstall exec } ifelse setglobal % return to original VM allocation mode -} .bind executeonly odef +} .forcebind odef % We break out the code after calling the Install procedure into a % separate procedure, since it is executed even if Install causes an error. diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_statd.ps b/Master/tlpkg/tlgs/Resource/Init/gs_statd.ps index 35a512aadfd..0ad9fc36e06 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_statd.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_statd.ps @@ -38,7 +38,7 @@ statusdict begin } { pop pop % success -- pop the arguments } ifelse -} bind def +} .internalbind def % Keep the table of named paper sizes as procedures. Reuse them later % as compatibility operators. @@ -150,8 +150,8 @@ readonly def % Define the pagetype values for the known page formats. % This array is now used for deterministic enumeration of .pagetypeprocs -/.pagetypenames [ .pagetypeprocs { pop } bind forall ] - { .namestring exch .namestring gt } bind .sort +/.pagetypenames [ .pagetypeprocs { pop } .internalbind forall ] + { .namestring exch .namestring gt } .internalbind .sort readonly def %%%%%% The following items were suggested by a user as useful. @@ -160,41 +160,41 @@ readonly def /ramsize 4194304 def /hardwareiomode 0 def - /sethardwareiomode {pop} bind def + /sethardwareiomode {pop} .internalbind def /softwareiomode 0 def - /setsoftwareiomode {pop} bind def + /setsoftwareiomode {pop} .internalbind def /dosysstart //false def - /setdosysstart {pop} bind def + /setdosysstart {pop} .internalbind def /allowjobreset //true def - /setallowjobreset {pop} bind def + /setallowjobreset {pop} .internalbind def /defaultpaperfamily 0 def - /setdefaultpaperfamily {pop} bind def + /setdefaultpaperfamily {pop} .internalbind def /defaultpapertray 0 def - /setdefaultpapertray {pop} bind def + /setdefaultpapertray {pop} .internalbind def /defaulttrayswitch //false def - /setdefaulttrayswitch {pop} bind def + /setdefaulttrayswitch {pop} .internalbind def % Tray and format selection -/11x17tray {/11x17 .uservar stopped { pop pop /11x17tray $error /errorname get signalerror } if } bind executeonly def -/a3tray {/a3 .uservar stopped { pop pop /a3tray $error /errorname get signalerror } if } bind executeonly def -/a4tray {/a4 .uservar stopped { pop pop /a4tray $error /errorname get signalerror } if } bind executeonly def -/a5tray {/a5 .uservar stopped { pop pop /a5tray $error /errorname get signalerror } if } bind executeonly def -/a6tray {/a6 .uservar stopped { pop pop /a6tray $error /errorname get signalerror } if } bind executeonly def -/b4tray {/b4 .uservar stopped { pop pop /b4tray $error /errorname get signalerror } if } bind executeonly def -/b5tray {/b5 .uservar stopped { pop pop /b5tray $error /errorname get signalerror } if } bind executeonly def -/flsatray {/flsa .uservar stopped { pop pop /flsatray $error /errorname get signalerror } if } bind executeonly def -/flsetray {/flse .uservar stopped { pop pop /flsetray $error /errorname get signalerror } if } bind executeonly def -/halflettertray {/halfletter .uservar stopped { pop pop /halflettertray $error /errorname get signalerror } if } bind executeonly def -/ledgertray {/ledger .uservar stopped { pop pop /ledgertray $error /errorname get signalerror } if } bind executeonly def -/legaltray {/legal .uservar stopped { pop pop /legaltray $error /errorname get signalerror } if } bind executeonly def -/lettertray {/letter .uservar stopped { pop pop /lettertray $error /errorname get signalerror } if } bind executeonly def +/11x17tray {/11x17 .uservar stopped { pop pop /11x17tray $error /errorname get signalerror } if } .internalbind def +/a3tray {/a3 .uservar stopped { pop pop /a3tray $error /errorname get signalerror } if } .internalbind def +/a4tray {/a4 .uservar stopped { pop pop /a4tray $error /errorname get signalerror } if } .internalbind def +/a5tray {/a5 .uservar stopped { pop pop /a5tray $error /errorname get signalerror } if } .internalbind def +/a6tray {/a6 .uservar stopped { pop pop /a6tray $error /errorname get signalerror } if } .internalbind def +/b4tray {/b4 .uservar stopped { pop pop /b4tray $error /errorname get signalerror } if } .internalbind def +/b5tray {/b5 .uservar stopped { pop pop /b5tray $error /errorname get signalerror } if } .internalbind def +/flsatray {/flsa .uservar stopped { pop pop /flsatray $error /errorname get signalerror } if } .internalbind def +/flsetray {/flse .uservar stopped { pop pop /flsetray $error /errorname get signalerror } if } .internalbind def +/halflettertray {/halfletter .uservar stopped { pop pop /halflettertray $error /errorname get signalerror } if } .internalbind def +/ledgertray {/ledger .uservar stopped { pop pop /ledgertray $error /errorname get signalerror } if } .internalbind def +/legaltray {/legal .uservar stopped { pop pop /legaltray $error /errorname get signalerror } if } .internalbind def +/lettertray {/letter .uservar stopped { pop pop /lettertray $error /errorname get signalerror } if } .internalbind def % Per-job parameters /paperfamily 0 def % 0 is US, 1 is European /papertray 1 def - /setpapertray {statusdict exch /papertray exch put} bind def + /setpapertray {statusdict exch /papertray exch put} .internalbind def /trayswitch //false def % paperout feeds from another tray % We don't implement the (undocumented by Adobe) papersize 'operator', % because it's very awkward to make it interact properly with all the @@ -206,43 +206,43 @@ readonly def %%%%%% Reference Manual, First Edition, and subsequent 'compatibility' %%%%%% documentation from Adobe. - /checkpassword {statusdict begin .password eq end} bind def - /defaulttimeouts {statusdict begin .timeouts aload pop end} bind def + /checkpassword {statusdict begin .password eq end} .internalbind def + /defaulttimeouts {statusdict begin .timeouts aload pop end} .internalbind def /diskonline { //false (%disk*%) { pop not exit } 8192 string /IODevice resourceforall - } bind def - /diskstatus {10240 2097152 } bind odef % - diskstatus <free> <total> (in 1024 byte pages) + } .internalbind def + /diskstatus {10240 2097152 } .internalbind odef % - diskstatus <free> <total> (in 1024 byte pages) %/dostartpage - /eescratch {pop 0} bind def - /idlefonts {statusdict begin mark .idlefonts aload pop end} bind def + /eescratch {pop 0} .internalbind def + /idlefonts {statusdict begin mark .idlefonts aload pop end} .internalbind def /jobname () def %/jobtimeout /manualfeed //false def /manualfeedtimeout 60 def - /margins {statusdict begin .topmargin .leftmargin end} bind def - /pagecount {4711} bind def - /pagestackorder {//false} bind def + /margins {statusdict begin .topmargin .leftmargin end} .internalbind def + /pagecount {4711} .internalbind def + /pagestackorder {//false} .internalbind def /pagetype 0 def /prefeed //false def - /printererror {pop pop} bind def - /printername {statusdict /.printername get exch copy} bind def + /printererror {pop pop} .internalbind def + /printername {statusdict /.printername get exch copy} .internalbind def /processcolors /processcolors load def % defined in systemdict /product product def % product is defined in systemdict /revision revision def % revision is defined in systemdict - /sccbatch {pop 9600 0} bind def - /sccinteractive {pop 9600 0} bind def - /setdefaulttimeouts {statusdict begin .timeouts astore pop end} bind def - /setdostartpage {statusdict exch /dostartpage exch put} bind def - /setduplexmode {mark /Duplex 3 -1 roll currentdevice putdeviceprops} bind def - /seteescratch {pop pop} bind def - /setidlefonts {] statusdict exch /.idlefonts exch put} bind def - /setjobtimeout {statusdict exch /jobtimeout exch put} bind def + /sccbatch {pop 9600 0} .internalbind def + /sccinteractive {pop 9600 0} .internalbind def + /setdefaulttimeouts {statusdict begin .timeouts astore pop end} .internalbind def + /setdostartpage {statusdict exch /dostartpage exch put} .internalbind def + /setduplexmode {mark /Duplex 3 -1 roll currentdevice putdeviceprops} .internalbind def + /seteescratch {pop pop} .internalbind def + /setidlefonts {] statusdict exch /.idlefonts exch put} .internalbind def + /setjobtimeout {statusdict exch /jobtimeout exch put} .internalbind def /setmargins { statusdict begin /.leftmargin exch def /.topmargin exch def end - } bind def + } .internalbind def % The following compatibility operators are only documented by Adobe in a % supplement to the Red Book. @@ -260,20 +260,20 @@ readonly def % We follow the convention that ORIENT1 determines the orientation value % that means portait: false means 0, true means 1. - /pagemargin { 0 } bind def + /pagemargin { 0 } .internalbind def /pageparams { currentdevice 1 dict dup /.MediaSize dup put .getdeviceparams exch pop exch pop aload pop 0 ORIENT1 { 1 } { 0 } ifelse - } bind def + } .internalbind def /setpage { ORIENT1 { 1 } { 0 } ifelse ne {exch} if //.setpagesize exec - } bind def - /setpagemargin {pop} bind def % can't do better without setpagedevice + } .internalbind def + /setpagemargin {pop} .internalbind def % can't do better without setpagedevice /setpageparams { exch pop ORIENT1 { 1 } { 0 } ifelse ne {exch} if //.setpagesize exec - } bind def + } .internalbind def /setpagetype { statusdict begin % The Adobe documentation only defines setpagetype @@ -291,15 +291,15 @@ readonly def /pagetype exch def } ifelse end - } bind def + } .internalbind def /setpassword {exch checkpassword {statusdict exch /.password exch put //true} {pop //false} - ifelse} bind def + ifelse} .internalbind def /setprintername - {dup length string copy statusdict exch /.printername exch put} bind def + {dup length string copy statusdict exch /.printername exch put} .internalbind def % setresolution is not documented by Adobe, but some applications % use it anyway, without testing whether or not it is present. @@ -311,10 +311,10 @@ readonly def /setresolution { mark /HWResolution [ 4 -1 roll dup ] currentdevice putdeviceprops pop initmatrix erasepage - } bind def - /setsccbatch {pop pop pop} bind def - /setsccinteractive {pop pop pop} bind def - /settumble {pop} bind def + } .internalbind def + /setsccbatch {pop pop pop} .internalbind def + /setsccinteractive {pop pop pop} .internalbind def + /settumble {pop} .internalbind def /waittimeout 300 def %%%%%% End of documented items. @@ -381,13 +381,13 @@ systemdict begin serverdict begin - /execjob { } bind def + /execjob { } .internalbind def % The Red Book implies that something like the following is % an appropriate definition of exitserver. - /exitserver { clear stop } bind def + /exitserver { clear stop } .internalbind def % However, this interacts badly with our standard error handler, % so we override it with the following less appropriate definition. - /exitserver { 0 ne { clear cleardictstack } if } bind def - /setrealdevice { } bind def + /exitserver { 0 ne { clear cleardictstack } if } .internalbind def + /setrealdevice { } .internalbind def end % serverdict diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_trap.ps b/Master/tlpkg/tlgs/Resource/Init/gs_trap.ps index ea8f72a73b8..cac6760debd 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_trap.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_trap.ps @@ -36,7 +36,7 @@ languagelevel dup 2 .max .setlanguagelevel } forall pop dup .settrapparams % Let the operator check parameter validity. .userdict /.trapparams 3 -1 roll put pop -} bind executeonly .makeoperator +} .internalbind .makeoperator /.copyparams { % <obj> .copyparams <obj'> dup type /dicttype eq { @@ -53,12 +53,12 @@ languagelevel dup 2 .max .setlanguagelevel /currenttrapparams dup { % - currenttrapparams <paramdict> /.trapparams .uservar .copyparams -} bind executeonly .makeoperator +} .internalbind executeonly .makeoperator /settrapzone dup { % - settrapzone - % ****** DUMMY ****** newpath -} bind .makeoperator +} .internalbind .makeoperator % Define initial (dummy) trapping parameters. % These values are mostly complete guesses. diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_ttf.ps b/Master/tlpkg/tlgs/Resource/Init/gs_ttf.ps index 8666d787395..348173e2f68 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_ttf.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_ttf.ps @@ -74,7 +74,7 @@ } ifelse } for exch pop -} .bind def +} .forcebind def % Make /MacRomanEncodingForTrueType including additional % characters in Mac OS Roman encoding, which is missing @@ -168,29 +168,29 @@ 16#ffffffff idiv } if exch //.setCPSImode -} .bind def +} .forcebind def /nextxuid { % - nextxuid - 3 -1 0 { xuidstring 1 index 2 copy get dup 255 ne { 1 add put pop exit } if pop 0 put pop } for -} bind def +} .internalbind def % <string> <index> getu16 <integer> /getu16 { 2 copy get 8 bitshift 3 1 roll 1 add get add -} .bind def +} .forcebind def % <string> <index> gets16 <integer> /gets16 { getu16 16#8000 xor 16#8000 sub -} .bind def +} .forcebind def % <string> <index> getu32 <integer> /getu32 { 2 copy getu16 16 bitshift 3 1 roll 2 add getu16 add -} .bind def +} .forcebind def % <string> <index> gets32 <integer> /gets32 { @@ -200,17 +200,17 @@ % <string|array> <index> getu16 <integer> /getu16a { 2 getinterval_from_stringarray 0 getu16 -} .bind def +} .forcebind def % <string|array> <index> gets16 <integer> /gets16a { 2 getinterval_from_stringarray 0 gets16 -} .bind def +} .forcebind def % <string|array> <index> getu32a <integer> /getu32a { 4 getinterval_from_stringarray 0 getu32 -} .bind def +} .forcebind def % <string|array> <index> gets32a <integer> /gets32a { @@ -228,13 +228,13 @@ /putu16 { 3 copy -8 bitshift put exch 1 add exch 16#ff and put -} .bind def +} .forcebind def % <string> <index> <integer> putu32 - /putu32 { 3 copy -16 bitshift putu16 exch 2 add exch 16#ffff and putu16 -} .bind def +} .forcebind def % <nametable> <nameid> findname <string> true % <nametable> <nameid> findname false @@ -288,7 +288,7 @@ TTFDEBUG { dup { ( = ) print 1 index //== exec } { ( not found) = } ifelse } if -} .bind def +} .forcebind def % <namerecord> is2byte <bool> /is2byte { @@ -304,7 +304,7 @@ dup length 1 sub 2 index lt {exch pop dup length 1 sub}{exch} ifelse get exec -} .bind def +} .forcebind def % <string> is2byte2 <bool> /is2byte2 { @@ -320,7 +320,7 @@ } for exch pop } ifelse -} .bind def +} .forcebind def % <string2> string2to1 <string> /string2to1 { @@ -328,7 +328,7 @@ 0 1 3 index length 1 sub { 3 index 1 index 2 mul 1 add get put dup } for pop exch pop -} .bind def +} .forcebind def % Each procedure in this dictionary is called as follows: % <encodingtable> proc <glyph dictionary> @@ -338,7 +338,7 @@ mark 0 3 -1 roll { 1 index 1 add } forall pop .dicttomark - } .bind + } .forcebind 2 { % Apple 16bit CJK (ShiftJIS etc) % /sHK_sz subHeaderKey_size % 1 * uint16 @@ -416,7 +416,7 @@ } for pop cmapf2_glyph_array - } .bind + } .forcebind 4 { % Microsoft/Adobe segmented mapping. /etab exch def /nseg2 etab 6 getu16a def @@ -499,7 +499,7 @@ % If we've encoutered an invalid table, remove the key before returning glyphs /.cmap_warning_issued undef glyphs /glyphs //null def % for GC - } .bind + } .forcebind 6 { % Single interval lookup. dup 6 getu16a /firstcode exch def dup 8 getu16a /ng exch def @@ -511,7 +511,7 @@ dup firstcode add exch 2 mul 10 add 4 index exch getu16a 3 copy put pop pop } for pop exch pop - } .bind + } .forcebind 12 { % Microsoft/Adobe segmented mapping. /etab exch def /glyphs 0 dict def @@ -530,7 +530,7 @@ } for } for glyphs /glyphs //null def % for GC - } .bind + } .forcebind .dicttomark readonly def % cmapformats % <cmaptab> cmapdict <glyph dictionary> @@ -546,7 +546,7 @@ TTFDEBUG { (cmap: length=) print dup length = dup === } if -} .bind def +} .forcebind def /get_from_stringarray % <array|string> <offset> get_from_stringarray <int> { 1 index type /stringtype eq { @@ -560,7 +560,7 @@ } ifelse } forall } ifelse -} .bind def +} .forcebind def /getinterval_from_stringarray % <array|string> <offset> <length> getinterval_from_stringarray <string> { % May allocate a string in VM. @@ -608,7 +608,7 @@ ] } ifelse } ifelse -} .bind def +} .forcebind def /string_array_size % <array|string> string_array_size <int> { dup type /stringtype eq { @@ -616,7 +616,7 @@ } { 0 exch { length add } forall } ifelse -} .bind def +} .forcebind def % Each procedure in this dictionary is called as follows: % posttable <<proc>> glyphencoding @@ -729,18 +729,18 @@ } if } ifelse - } .bind + } .forcebind 16#00030000 { % No map. pop [ ] - } .bind + } .forcebind .dicttomark readonly def % postformats /call.readtable { .readtable -} .bind def +} .forcebind def /call.readbigtable { .readbigtable -} .bind def +} .forcebind def % Each procedure in this dictionary is called as follows: % <file> <length> -proc- <string|array_of_strings> @@ -780,7 +780,7 @@ def % <file> <length> .skiptable <string> /.skiptable { pop pop () -} .bind def +} .forcebind def % Read a table as a single string. % <file> <length> .readtable <string> @@ -794,7 +794,7 @@ def % this explicitly here. 3 -1 roll exch dup () ne { readstring } if pop pop -} .bind def +} .forcebind def % Read a big table (one that may exceed 64K). % <file> <length> .readbigtable <string[s]> @@ -810,7 +810,7 @@ def } loop .readtable ] exch vmreclaim } ifelse -} .bind def +} .forcebind def end readonly def % .loadttfontdict @@ -819,7 +819,7 @@ end readonly def % .loadttfontdict dup 0 4 getinterval print ( ) print dup 8 getu32 =only ( ) print 12 getu32 = -} bind def +} .internalbind def % <file> <bool> <SubfontID> .loadttfonttables - % Pushes .loadttfontdict & scratch dict on d-stack. @@ -893,7 +893,7 @@ end readonly def % .loadttfontdict 2 index 12 3 -1 roll putu32 } if pop pop } for -} .bind executeonly def +} .forcebind def @@ -940,7 +940,7 @@ end readonly def % .loadttfontdict { exch 4 getu32 exch 4 getu32 lt } .sort def } ifelse -} .bind def +} .forcebind def /.file_table_pos_names mark @@ -1007,7 +1007,7 @@ mark } ifelse /fpos fpos tclen add def } for -} .bind def +} .forcebind def % Find the string in a list of strings that includes a given index. % <strings> <index> .findseg <string> <index'> @@ -1016,7 +1016,7 @@ mark dup length 2 index gt { exch exit } if length sub } forall -} .bind def +} .forcebind def % - .makesfnts - % Defines checksum, getloca, head, locatable, numloca, post, sfnts, upem @@ -1063,12 +1063,12 @@ mark dup type /stringtype ne { aload pop } if } forall ] def -} .bind executeonly odef +} .forcebind odef /first_post_string % - first_post_string <string> { post dup type /arraytype eq { 0 get } if -} bind def +} .internalbind def % - .getpost - % Uses post, defines glyphencoding @@ -1089,7 +1089,7 @@ mark } ifelse TTFDEBUG { (post=) print dup //== exec } if def -} .bind def +} .forcebind def % - .ttkeys <key> <value> ... /.ttkeys { @@ -1129,7 +1129,7 @@ mark count ttkeycount sub array astore dup { //== exec } forall aload pop } if /sfnts sfnts -} .bind def +} .forcebind def % ---------------- Standard TrueType font loading ---------------- % @@ -1153,7 +1153,7 @@ mark /cmapsub 2 index def % () [] exch 4 getu32 1 index string_array_size 1 index sub getinterval_from_stringarray /cmaptab exch def -} .bind def +} .forcebind def % - .pickcmap_with_xlatmap - % Defines cmapsub, cmaptab @@ -1217,7 +1217,7 @@ mark QUIET not { (True Type font doesn't contain a charset listed in gs/lib/xlatmap.) = } if /.pickcmap_with_xlatmap cvx /invalidfont signalerror } if % -} .bind def +} .forcebind def % - .pickcmap - % Defines cmapsub, cmaptab @@ -1237,14 +1237,14 @@ mark } { //.pickcmap_with_no_xlatmap exec } ifelse -} .bind executeonly odef +} .forcebind odef currentdict /.pickcmap_with_xlatmap .undef currentdict /.pickcmap_with_no_xlatmap .undef % <glyph> .nname <_name> /.nname { =string cvs (_) exch concatstrings cvn -} bind def +} .internalbind def % - .charkeys /CharStrings <charstrings> /Encoding <encoding> @@ -1403,7 +1403,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef } ifelse ] TTFDEBUG { (Encoding: ) print dup === flush } if -} .bind odef +} .forcebind odef % ---------------- CIDFontType 2 font loading ---------------- % @@ -1421,7 +1421,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef pop 1 add % () v+1 } for pop -} .bind def +} .forcebind def % <CIDSystemInfo dict> <dict> .definettcidfont <font> /.definettcidfont { @@ -1450,7 +1450,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef end end end dup /CIDFontName get exch /CIDFont defineresource -} .bind def +} .forcebind def % <CIDSystemInfo dict> <file> <Substite name> .loadttcidfont <cidtype2font> /.loadttcidfont { @@ -1467,7 +1467,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef /fontname exch def /FontName exch put % replace any definition of /FontName //.definettcidfont exec -} .bind executeonly odef +} .forcebind odef % <file> <SubfontID> .load_tt_font_stripped <font_data> % The font_data includes sfnts, NumGlyphs, TT_cmap, file_table_pos, Decoding. @@ -1484,7 +1484,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef /Decoding Decoding .dicttomark end end -} .bind executeonly def +} .forcebind def /.load_woff_for_cid { //false exch //.loadwofftables exec @@ -1503,7 +1503,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef /Decoding Decoding .dicttomark end end -} .bind executeonly def +} .forcebind def % ---------------- PDF TrueType font loading ---------------- % @@ -1527,7 +1527,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef } for % Stack: false plat+enc cmap || subtable true plat+enc cmap pop pop -} .bind def +} .forcebind def % Build .symbol_list for .pdfcharkeys . % It is a dictionary containing all SymbolEncoding glyph names @@ -1546,7 +1546,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef exch //.symbol_list 3 1 roll put } for pop -} .bind exec +} .forcebind exec % Create .GS_extended_SymbolEncoding as inverse of .symbol_list . { @@ -1555,7 +1555,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef exch 2 index 3 1 roll put } forall .defineencoding -} .bind exec +} .forcebind exec /.hexdigits (0123456789ABCDEF) def @@ -1566,10 +1566,10 @@ currentdict /.pickcmap_with_no_xlatmap .undef 70 le and 3 1 roll and or -} .bind def +} .forcebind def -/.popfex { pop //false exit } bind def -/.pop3ex { pop pop pop exit } bind def +/.popfex { pop //false exit } .internalbind def +/.pop3ex { pop pop pop exit } .internalbind def /.addglyph { % <dict> <name> <glyph#> .addglyph - 1 index .namestring % d n g s @@ -1616,7 +1616,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef put exit } loop } if -} .bind def +} .forcebind def % <chartoglyphmap> <subcmap> <AGL> .pdfmapchars /CharStrings <charstrings> /.pdfmapchars { @@ -1658,7 +1658,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef } forall dup /.notdef 0 put -} .bind def +} .forcebind def % <subtable> .pdfmapsymbolic /Encoding [] /CharStrings <<>> /.pdfmapsymbolic { @@ -1689,7 +1689,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef /.notdef 0 def /Encoding exch /CharStrings currentdict end -} .bind def +} .forcebind def % If we're using a 1,0 cmap table, we need to store the table for the heuristic % to know whether to image or elide GID 0. See zfapi.c ps_get_glyphname_or_cid(). @@ -1797,7 +1797,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef } ifelse } if TTFDEBUG { (.pdfcharkeys end) = } if -} .bind executeonly def +} .forcebind def % <file> <is_symbolic> <Encoding|null> <FontName> .loadpdfttfont <type42font> /.loadpdfttfont { @@ -1855,7 +1855,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef dup /FontName font_name put % replace any definition of /FontName end end .completefont -} .bind executeonly odef +} .forcebind odef %--------- Define main type42font loading routines, after their dependencies ------------ % <file> .loadttfont <type42font> @@ -1890,7 +1890,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef } if .dicttomark end end dup /FontName get exch definefont -} .bind executeonly def +} .forcebind def % <file> .loadwofffont <type42font> /.loadwofffont @@ -1911,7 +1911,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef .dicttomark end end dup /FontName get exch definefont -} .bind executeonly def +} .forcebind def % ----- Utilities for loading possible TrueType font ------ % <file> .findttfontname <fname> true @@ -1935,7 +1935,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef //false } ifelse f closefile end end -} .bind def +} .forcebind def /.findwoffname { //true 0 //.loadwofftables exec @@ -1962,7 +1962,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef //false } ifelse f closefile end end -} .bind def +} .forcebind def /tt_tag_dict << <00010000> 0 (true) 0 (typ1) 0 (ttcf) 0 >> readonly def /ttf_otf_tag_dict << <00010000> 0 (true) 0 (typ1) 0 (ttcf) 0 (OTTO) 0>> readonly def @@ -1978,11 +1978,11 @@ currentdict /.pickcmap_with_no_xlatmap .undef % <file> .is_ttf_or_otf <bool> /.is_ttf_or_otf { dup 0 setfileposition (1234) .peekstring { //ttf_otf_tag_dict exch known } { //false } ifelse -} .bind def +} .forcebind def /.is_woff { dup 0 setfileposition (1234) .peekstring { //woff_tag_dict exch known } { //false } ifelse -} .bind def +} .forcebind def % <file> <key> .findfontvalue <value> true % <file> <key> .findfontvalue false @@ -2009,7 +2009,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef .findnonttfontvalue } ifelse } ifelse -} .bind executeonly def +} .forcebind def % Load a font file that might be a TrueType font. % <file> .loadfontfile - @@ -2028,7 +2028,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef .loadnonttfontfile } ifelse } ifelse -} .bind def +} .forcebind def % Undef the local utility funcs [ diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_typ32.ps b/Master/tlpkg/tlgs/Resource/Init/gs_typ32.ps index 1263f4ef904..ac3ba86b3c6 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_typ32.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_typ32.ps @@ -59,11 +59,11 @@ systemdict /.makeglyph32 .undef } if 1 index /CharStrings get 3 index 3 -1 roll put pop pop pop pop -} obind +} executeonly obind /removeall { % <type32font> removeall - 0 65535 2 index removeglyphs pop -} obind +} executeonly obind /.removeglyphs systemdict /.removeglyphs get systemdict /.removeglyphs .undef @@ -74,7 +74,7 @@ systemdict /.removeglyphs .undef % Stack: cidmin cidmax font CharStrings cid bitmap pop dup 5 index ge { dup 4 index le { 2 copy undef } if } if pop } forall pop pop pop pop -} obind +} executeonly obind .dicttomark /ProcSet defineresource pop @@ -84,7 +84,7 @@ systemdict /.removeglyphs .undef dup /FontType 32 .forceput dup /CharStrings 20 dict .forceput 1 index exch .buildfont32 exch pop -} .bind executeonly odef +} .forcebind odef .cidfonttypes begin @@ -126,7 +126,7 @@ currentdict /CIDFontType4 .forceundef [ 1 0 0 1 11 -2 roll exch neg exch neg ] 5 -1 roll imagemask } ifelse pop pop pop pop -} .bind def +} .forcebind def systemdict /.getmetrics32 .undef diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_typ42.ps b/Master/tlpkg/tlgs/Resource/Init/gs_typ42.ps index e689f3def1e..0b0fdc01da7 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_typ42.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_typ42.ps @@ -40,7 +40,7 @@ } bind executeonly def (%Type42BuildGlyph) cvn % <font> <name> %Type42BuildGlyph - { dup //.type42build exec - } bind executeonly def + } .internalbind def currentdict /.type42build .undef @@ -57,5 +57,5 @@ buildfontdict 42 } { systemdict /.buildfont42 get exec } ifelse - } bind + } .internalbind put diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_type1.ps b/Master/tlpkg/tlgs/Resource/Init/gs_type1.ps index f17a3f11b6e..47a81d41d5d 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_type1.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_type1.ps @@ -149,7 +149,7 @@ {//.buildfont1} stopped 4 3 roll .setglobal {//.buildfont1 $error /errorname get signalerror} if - } .bind executeonly def % hide .forceput + } .forcebind def % hide .forceput % container for CloseSource flag (default //true to prevent buildup of file handles) /closesourcedict mark @@ -178,7 +178,7 @@ cvx exec } ifelse } stopped -} bind executeonly def +} .internalbind def % If the diskfont feature isn't included, define a dummy .loadfontdict. /.loadfontdict where @@ -205,7 +205,7 @@ ifelse end { stop } if cleartomark - } bind def + } .internalbind def % undefine stuff that is only used internally, and is immediately bound currentdict /closesourcedict .undef currentdict /.loadfont1 .undef @@ -232,7 +232,7 @@ currentdict /.loadfont1 .undef { CFFCharStrings 0 get} if } if end -} bind def +} .internalbind def % Here are the BuildChar and BuildGlyph implementation for Type 1 fonts. % The names %Type1BuildChar and %Type1BuildGlyph are known to the interpreter. @@ -241,10 +241,10 @@ currentdict /.loadfont1 .undef (%Type1BuildChar) cvn { % <font> <code> %Type1BuildChar - 1 index /Encoding get 1 index get //.type1build exec .type1execchar -} bind executeonly def +} .internalbind def (%Type1BuildGlyph) cvn { % <font> <name> %Type1BuildGlyph - dup //.type1build exec .type1execchar -} bind executeonly def +} .internalbind def 1183615869 internaldict begin % CCRun is an undocumented procedure provided for Type 4 and Type 0 fonts. @@ -276,7 +276,7 @@ currentdict /.loadfont1 .undef 1 index dup type /integertype eq { 3 index /Encoding get exch get } if exch .type1execchar -} bind def +} .internalbind def % setweightvector is an undocumented procedure that force writes % weight vector to the font. Do extra checks for safety. @@ -293,7 +293,7 @@ currentdict /.loadfont1 .undef } if 2 copy /WeightVector exch .forceput .setweightvector -} .bind executeonly odef +} .forcebind odef end % Register the font types for definefont. @@ -305,9 +305,9 @@ buildfontdict 4 /.buildfont4 cvx put pop (%Type2BuildChar) cvn { % <font> <code> %Type2BuildChar - 1 index /Encoding get 1 index get //.type1build exec .type2execchar -} bind executeonly def +} .internalbind def (%Type2BuildGlyph) cvn { % <font> <name> %Type2BuildGlyph - dup //.type1build exec .type2execchar -} bind executeonly def +} .internalbind def buildfontdict 2 /.buildfont2 cvx put %END2 diff --git a/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps b/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps index e541835aeb8..98c7ea011c1 100644 --- a/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps +++ b/Master/tlpkg/tlgs/Resource/Init/pdf_main.ps @@ -140,7 +140,7 @@ systemdict /NEWPDF known { { <</DisablePageHandler //true>> setpagedevice } if -} bind def +} .internalbind def /EnablePageHandlerDevice { @@ -150,12 +150,12 @@ systemdict /NEWPDF known { { <</DisablePageHandler //false>> setpagedevice } if -} bind def +} .internalbind def /newpdf_pdfformaterror { % <string> pdfformaterror - (%stdout) (w) file dup 3 -1 roll writestring flushfile -} bind executeonly def +} .internalbind def % This routine sets up the transparency compositor requirement, and % number of spot channels required (if any) in the device. This needs @@ -177,7 +177,7 @@ systemdict /NEWPDF known { pop } ifelse setpagedevice -}bind def +}.internalbind def % Takes the selected Box as a parameter and scales it to fit the current media. % If the amount of scaling would be reduced by rotating the content, then @@ -230,9 +230,22 @@ systemdict /NEWPDF known { % If we need to rotate, recalculate the box { - 90 rotate - 0 2 index neg translate % move 0,0 to bottom right of media to account for rotation - exch % swap media width/height for scaling calculation + % We take any existing /Rotate key in the dictionary into account as well, because + % that way we will preserve the orientation which would be used when displaying + % the original, un-modified page. Note that PostScript's rotate operator works + % counter-clockwise, while PDF works clockwise.... + % + 7 index dup /Rotate known {/Rotate get}{90}ifelse + 270 eq { + 90 rotate + 0 2 index neg translate % move 0,0 to bottom right of media to account for rotation + exch % swap media width/height for scaling calculation + } + { + 270 rotate + dup neg 0 translate % move 0,0 to bottom right of media to account for rotation + exch % swap media width/height for scaling calculation + } ifelse }if % Now use the box and media values to calculate the required x/y scale factors @@ -271,7 +284,7 @@ systemdict /NEWPDF known { dup scale % scale both axes the same pop pop pop % remove the leftover boxwidth, boxheight and mediawidth/height -} bind def +} .internalbind def /newpdf_get_media_box { % <pagedict> get_media_box <box> <bool> dup /MediaBox known { @@ -295,7 +308,7 @@ systemdict /NEWPDF known { ( Output may be incorrect.\n) newpdf_pdfformaterror [ 0 0 currentpagedevice /PageSize get aload pop ] //false } ifelse -} bind executeonly def +} .internalbind def % [llx lly urx ury] newpdf_check_empty_box [llx lly urx ury] true | false % rturns true and the original array if its valid, otherwise returns false @@ -329,7 +342,7 @@ systemdict /NEWPDF known { ( Output may be incorrect.\n) print flush pop //false } ifelse -} bind executeonly def +} .internalbind def /newpdf_get_any_box { % <pagedict> get_any_box <box name> <box> //systemdict /UseBleedBox .knownget dup { and } if { @@ -434,7 +447,7 @@ systemdict /NEWPDF known { } ifelse 4 array astore % /SomeBox [mX0 mY0 mX1 mY1] } ifelse -} bind executeonly def +} .internalbind def % This routine is used to set the PostScript /PageSize from the requested Box of the % PDF file. Much of this is copied from the old pdfshowpage_setpage routine which @@ -634,7 +647,7 @@ systemdict /NEWPDF known { }ifelse pop -} bind executeonly def +} .internalbind def % This routine checks a list of known/implemented command line switches to see if they % have been defined in the PostScript environment. If they have we construct a dictionary @@ -667,7 +680,7 @@ systemdict /NEWPDF known { /PageCount /CumulativePageCount where { /CumulativePageCount get }{currentpagedevice /PageCount get} ifelse def currentdict end -} bind executeonly def +} .internalbind def currentdict /PDFSwitches undef @@ -704,14 +717,13 @@ currentdict /PDFSwitches undef { pop 0 } ifelse -}bind def +}.internalbind def /runpdfpagerange { /PageList where { pop - pdfpagecount - .PDFparsePageList + PageList pdfpagecount .PDFparsePageList dup 0 eq { % No ranges, error (\n **** Error: Invalid PageList: ) print PageList print @@ -744,7 +756,7 @@ currentdict /PDFSwitches undef } if } ifelse } ifelse -} bind def +} .internalbind def /runpdf_collection_entry @@ -771,7 +783,7 @@ currentdict /PDFSwitches undef } { pop pop }ifelse -} bind def +} .internalbind def % <file> runpdf - /newpdf_runpdf @@ -803,7 +815,7 @@ currentdict /PDFSwitches undef } { pop pop }ifelse -} bind def +} .internalbind def % start a PDF file, and specify interpreter parameters to be used % to override any command line ones. @@ -866,13 +878,13 @@ currentdict /PDFSwitches undef pop }ifelse }ifelse -} bind def +} .internalbind def % -file- runpdfbegin - /runpdfbegin { <<>> runpdfbegin_with_params -} bind def +} .internalbind def /pdfgetpage { @@ -895,21 +907,21 @@ currentdict /PDFSwitches undef /Page# exch put } ifelse }ifelse -} bind def +} .internalbind def /process_trailer_attrs { -}bind def +}.internalbind def /pdfshowpage_init { -} bind def +} .internalbind def /pdfshowpage_setpage { dup newpdf_device_setup dup newpdf_set_pagesize -} bind def +} .internalbind def /pdfshowpage_finish { @@ -931,7 +943,7 @@ currentdict /PDFSwitches undef ( Could not draw this page at all, page will be missing in the output.\n) newpdf_pdfformaterror } if }ifelse -} bind def +} .internalbind def /pdfshowpage { @@ -944,7 +956,7 @@ currentdict /PDFSwitches undef pdfshowpage_setpage pdfshowpage_finish }ifelse -} bind def +} .internalbind def /runpdfend { @@ -965,7 +977,7 @@ currentdict /PDFSwitches undef % add the number of pages already in the output to the 'Dest' of % Outlines and Link annotations. add <</PageCount 3 -1 roll >> setpagedevice -} bind def +} .internalbind def /pdfopen { @@ -999,7 +1011,7 @@ currentdict /PDFSwitches undef pop <</NumPages 0>> } ifelse -} bind def +} .internalbind def /pdfclose { @@ -1013,12 +1025,12 @@ currentdict /PDFSwitches undef pop } if }ifelse -} bind def +} .internalbind def /pdfavailable { .PDFAvailable -} bind def +} .internalbind def % <int> <int> dopdfpages - % First Page and then LastPage @@ -1078,7 +1090,7 @@ currentdict /PDFSwitches undef } for } ifelse //EnablePageHandlerDevice exec -} bind def +} .internalbind def /.runps /run load def /run { @@ -1153,7 +1165,7 @@ currentdict /PDFSwitches undef } { closefile % file was empty } ifelse -} bind odef +} .internalbind odef currentdict /runpdfstring .undef currentdict /DisablePageHandlerDevice undef @@ -1188,7 +1200,7 @@ currentdict /EnablePageHandlerDevice undef } { closefile } ifelse -} bind executeonly def +} .internalbind def % Recursively enumerate /Names entries % <node> pdf_collection_names /temp_file_name ... @@ -1217,7 +1229,7 @@ currentdict /EnablePageHandlerDevice undef } forall } if } ifelse -} bind executeonly def +} .internalbind def /runpdf { % <file> runpdf - dup type /filetype eq @@ -1238,7 +1250,7 @@ currentdict /EnablePageHandlerDevice undef { ( **** Error: Attempt to process something other than a file object in runpdf.\n) pdfformaterror } ifelse -} bind executeonly odef +} .internalbind odef end % systemdict @@ -1246,7 +1258,7 @@ end % systemdict % It is OK to use { (%stdin) run } here, because a startjob cannot occur. /.runstdin { { (%stdin) run } execute0 -} bind executeonly def +} .internalbind def end % userdict @@ -1268,7 +1280,7 @@ systemdict /ALLOWPSTRANSPARENCY get { /.setopacityalpha /undefined cvx signalerror } ifelse - } bind def + } .internalbind def /.setshapealpha { @@ -1284,7 +1296,7 @@ systemdict /ALLOWPSTRANSPARENCY get { /.setshapealpha /undefined cvx signalerror } ifelse - } bind def + } .internalbind def } if .setglobal |