diff options
Diffstat (limited to 'Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps')
-rw-r--r-- | Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps | 178 |
1 files changed, 84 insertions, 94 deletions
diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps b/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps index 44fe6195665..98d55fe7425 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps @@ -1,4 +1,4 @@ -% Copyright (C) 2001-2018 Artifex Software, Inc. +% Copyright (C) 2001-2019 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or @@ -64,7 +64,7 @@ level2dict begin pop } ifelse pop pop } forall pop pop -} .bind def % not odef, shouldn't reset stacks +} .bind 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 def +} .bind odef % Some user parameters are managed entirely at the PostScript level. % We take care of that here. @@ -117,7 +117,7 @@ counttomark 2 idiv { } repeat pop /.definepsuserparam { % <name> <value> .definepsuserparam - psuserparams 3 copy pop - type cvlit /.checkparamtype cvx 2 packedarray cvx put + type cvlit //.checkparamtype /exec load 3 packedarray cvx put userparams 3 1 roll put } .bind def end @@ -129,7 +129,7 @@ end /.setuserparams2 { % Check that we will be able to set the PostScript-level % user parameters. - /setuserparams /psuserparams .systemvar .checksetparams + /setuserparams /psuserparams .systemvar //.checksetparams exec % Set the C-level user params. If this succeeds, we know that % the password check succeeded. dup .setuserparams @@ -154,7 +154,8 @@ end % protect top level of parameters that we copied dup type dup /arraytype eq exch /stringtype eq or { readonly } if /userparams .systemvar 3 1 roll .forceput % userparams is read-only - } { + } executeonly + { pop pop } ifelse } forall @@ -210,8 +211,8 @@ end } forall } if /setsystemparams //pssystemparams mark exch { - type cvlit /.checkparamtype cvx 2 packedarray cvx - } forall .dicttomark .checksetparams + type cvlit //.checkparamtype /exec load 3 packedarray cvx + } forall .dicttomark //.checksetparams exec % Set the C-level system params. If this succeeds, we know that % the password check succeeded. dup .setsystemparams @@ -224,7 +225,7 @@ end % protect top level parameters that we copied dup type dup /arraytype eq exch /stringtype eq or { readonly } if //pssystemparams 3 1 roll .forceput % pssystemparams is read-only - } + } executeonly { pop pop } ifelse @@ -303,31 +304,30 @@ end psuserparams exch /.checkFilePermitparams load put .setglobal -pssystemparams begin - /CurDisplayList 0 .forcedef - /CurFormCache 0 .forcedef - /CurInputDevice () .forcedef - /CurOutlineCache 0 .forcedef - /CurOutputDevice () .forcedef - /CurPatternCache 0 .forcedef - /CurUPathCache 0 .forcedef - /CurScreenStorage 0 .forcedef - /CurSourceList 0 .forcedef - /DoPrintErrors //false .forcedef - /JobTimeout 0 .forcedef - /LicenseID (LN-001) .forcedef % bogus - /MaxDisplayList 140000 .forcedef - /MaxFormCache 100000 .forcedef - /MaxImageBuffer 524288 .forcedef - /MaxOutlineCache 65000 .forcedef - /MaxPatternCache 100000 .forcedef - /MaxUPathCache 300000 .forcedef - /MaxScreenStorage 84000 .forcedef - /MaxSourceList 25000 .forcedef - /PrinterName product .forcedef - /RamSize 4194304 .forcedef - /WaitTimeout 40 .forcedef -end +pssystemparams +dup /CurDisplayList 0 .forceput +dup /CurFormCache 0 .forceput +dup /CurInputDevice () .forceput +dup /CurOutlineCache 0 .forceput +dup /CurOutputDevice () .forceput +dup /CurPatternCache 0 .forceput +dup /CurUPathCache 0 .forceput +dup /CurScreenStorage 0 .forceput +dup /CurSourceList 0 .forceput +dup /DoPrintErrors //false .forceput +dup /JobTimeout 0 .forceput +dup /LicenseID (LN-001) .forceput % bogus +dup /MaxDisplayList 140000 .forceput +dup /MaxFormCache 100000 .forceput +dup /MaxImageBuffer 524288 .forceput +dup /MaxOutlineCache 65000 .forceput +dup /MaxPatternCache 100000 .forceput +dup /MaxUPathCache 300000 .forceput +dup /MaxScreenStorage 84000 .forceput +dup /MaxSourceList 25000 .forceput +dup /PrinterName product .forceput +dup /RamSize 4194304 .forceput + /WaitTimeout 40 .forceput % Define the procedures for handling comment scanning. The names % %ProcessComment and %ProcessDSCComment are known to the interpreter. @@ -344,13 +344,13 @@ end } ifelse } .bind def /ProcessComment //null .definepsuserparam -psuserparams /ProcessComment {.checkprocesscomment} put +psuserparams /ProcessComment {//.checkprocesscomment exec} put (%ProcessComment) cvn { /ProcessComment getuserparam dup //null eq { pop pop pop } { exec } ifelse } bind def /ProcessDSCComment //null .definepsuserparam -psuserparams /ProcessDSCComment {.checkprocesscomment} put +psuserparams /ProcessDSCComment {//.checkprocesscomment exec} put /.loadingfont //false def (%ProcessDSCComment) cvn { /ProcessDSCComment getuserparam @@ -434,7 +434,7 @@ psuserparams /ProcessDSCComment {.checkprocesscomment} put {pop /vmreclaim load $error /errorname get signalerror} {pop} ifelse } ifelse -} odef +} .bind executeonly odef -1 setvmthreshold % ------ IODevices ------ % @@ -492,7 +492,7 @@ end % serverdict clear cleardictstack initgraphics //false setglobal -} bind def +} bind executeonly def /.startjob { % <exit_bool> <password> <finish_proc> % .startjob <ok_bool> vmstatus pop pop serverdict /.jobsavelevel get eq @@ -515,14 +515,6 @@ end % serverdict { .startnewjob //true } .startjob } odef -% The procedure to undo the job encapsulation -/.endjob { - clear cleardictstack - serverdict /.jobsave get dup //null eq { pop } { restore } ifelse - serverdict /.jobsave //null put - 2 .vmreclaim % recover local and global VM -} odef - systemdict begin /quit { % - quit - //systemdict begin serverdict /.jobsave get //null eq @@ -555,7 +547,8 @@ end % serverdict % Note that statusdict must be allocated in local VM. % We don't bother with many of these yet. -/.dict1 { exch mark 3 1 roll .dicttomark } bind def +% convenience function to make a dictionary from an object and a key +/.pair2dict { exch mark 3 1 roll .dicttomark } bind def currentglobal //false setglobal 25 dict exch setglobal begin currentsystemparams @@ -568,11 +561,11 @@ systemdict /buildtime dup load put /checkpassword { .checkpassword 0 gt } bind def dup /DoStartPage known { /dostartpage { /DoStartPage getsystemparam } bind def - /setdostartpage { /DoStartPage .dict1 setsystemparams } bind def + /setdostartpage { /DoStartPage //.pair2dict exec setsystemparams } bind def } if dup /StartupMode known { /dosysstart { /StartupMode getsystemparam 0 ne } bind def - /setdosysstart { { 1 } { 0 } ifelse /StartupMode .dict1 setsystemparams } bind def + /setdosysstart { { 1 } { 0 } ifelse /StartupMode //.pair2dict exec setsystemparams } bind def } if %****** Setting jobname is supposed to set userparams.JobName, too. /jobname { /JobName getuserparam } bind def @@ -580,7 +573,7 @@ dup /StartupMode known /ramsize { /RamSize getsystemparam } bind def /realformat 1 index /RealFormat get def dup /PrinterName known - { /setprintername { /PrinterName .dict1 setsystemparams } bind def + { /setprintername { /PrinterName //.pair2dict exec setsystemparams } bind def } if /printername { currentsystemparams /PrinterName .knownget not { () } if exch copy @@ -615,19 +608,11 @@ currentuserparams /WaitTimeout known .dicttomark setpagedevice /WaitTimeout exch mark /JobTimeout 5 2 roll .dicttomark setsystemparams } bind def -/.setpagesize - { 2 copy 2 array astore /PageSize .dict1 { setpagedevice } stopped { - pop % the setpagedevice dict - /setpagesize $error /errorname get signalerror - } { - pop pop % success -- pop the arguments - } ifelse - } bind def -/setduplexmode { /Duplex .dict1 setpagedevice } bind def +/setduplexmode { /Duplex //.pair2dict exec setpagedevice } bind def /setmargins - { exch 2 array astore /Margins .dict1 setpagedevice + { exch 2 array astore /Margins //.pair2dict exec setpagedevice } bind def -/setpagemargin { 0 2 array astore /PageOffset .dict1 setpagedevice } bind def +/setpagemargin { 0 2 array astore /PageOffset //.pair2dict exec setpagedevice } bind def /setpageparams { mark /PageSize 6 -2 roll 4 index 1 and ORIENT1 { 1 } { 0 } ifelse ne { exch } if 2 array astore @@ -641,7 +626,7 @@ currentuserparams /WaitTimeout known { /setresolution /typecheck signalerror } if - dup 2 array astore /HWResolution .dict1 { setpagedevice } stopped { + dup 2 array astore /HWResolution //.pair2dict exec { setpagedevice } stopped { pop /setresolution $error /errorname get signalerror } if } bind def @@ -667,7 +652,7 @@ currentuserparams /WaitTimeout known } { % First see if the current value is valid so we don't have to guess mark .currentuserparams .dicttomark /ICCProfilesDir get - (default_gray.icc) concatstrings {status} .internalstopped + (default_gray.icc) concatstrings {status} //.internalstopped exec {pop //false} if { pop pop pop pop % current value was OK. Just clean up stack @@ -709,7 +694,7 @@ pop % currentsystemparams /statusdict currentdict def currentdict end -/statusdict exch .forcedef % statusdict is local, systemdict is global +currentdict exch /statusdict exch .forceput % statusdict is local, systemdict is global % The following compatibility operators are in systemdict. They are % defined here, rather than in gs_init.ps, because they require the @@ -915,34 +900,29 @@ mark .dicttomark ] def -% ------ Painting ------ % - -%% We don't want to do any high level forms stuff if the source -%% is PDF because : -%% 1) Transparent forms are handled separately and we don't want to ge confused -%% 2) PDF forms are too llikely to trip over the limitations in our support -%% 3) Its highly unusual to find a PDF file which uses forms sensibly. -%% -%% So we have a special PDF version of execform which doesn't do high level forms. +% Special type to install +% e-sRGB ICC profile color space +/CIEesRGBICC [ /ICCBased + mark + /N 3 + /DataSource (esrgb) + /Alternate [/DeviceRGB] + /Name (esrgb) + .dicttomark +] def -/.PDFexecform { - % This is a separate operator so that the stacks will be restored - % properly if an error occurs. - dup /Matrix get concat - dup /BBox get aload pop - exch 3 index sub exch 2 index sub rectclip - dup /PaintProc get - 1 index /Implementation known not { - 1 index dup /Implementation //null .forceput readonly pop - } if - exec -}.bind odef +% Special type to install +% rommRGB ICC profile color space +/CIErommRGBICC [ /ICCBased + mark + /N 3 + /DataSource (rommrgb) + /Alternate [/DeviceRGB] + /Name (rommrgb) + .dicttomark +] def -/PDFexecform { - gsave { - .PDFexecform - } stopped grestore {stop} if -} odef +% ------ Painting ------ % % A straightforward definition of execform that doesn't actually % do any caching. @@ -950,7 +930,7 @@ mark % This is a separate operator so that the stacks will be restored % properly if an error occurs. %% High level forms need the CTM before the Form Matrix is applied - /UNROLLFORMS where {/UNROLLFORMS get}{false}ifelse not + /UNROLLFORMS where {/UNROLLFORMS get}{//false}ifelse not {matrix currentmatrix exch} if dup /Matrix get concat dup /BBox get aload pop @@ -958,8 +938,8 @@ mark dup /PaintProc get 1 index /Implementation known not { 1 index dup /Implementation //null .forceput readonly pop - } if - /UNROLLFORMS where {/UNROLLFORMS get}{false}ifelse not + } executeonly if + /UNROLLFORMS where {/UNROLLFORMS get}{//false}ifelse not %% [CTM] <<Form>> PaintProc .beginform - { %% First,, check to see if we have no /Implementation already defined (see above) @@ -1005,7 +985,7 @@ mark %% Form dictioanry using the /Implementation key). 1 dict dup /FormID 4 -1 roll put 1 index exch /Implementation exch .forceput readonly pop - } + } executeonly ifelse } { @@ -1253,3 +1233,13 @@ def %END TN 5044 psuedo-ops end % level2dict + +% undefine things defined in this file and not referenced elsewhere +[ + /.checkprocesscomment + /.pair2dict + /.setcolorrendering1 + /.checkparamtype + /.checksetparams +] +{level2dict exch .forceundef} forall |