From 1aa28f76c8d59a00dcd74cfca9ab4a0e9e838ae5 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Thu, 5 Oct 2017 22:46:10 +0000 Subject: tlgs: typo etc. git-svn-id: svn://tug.org/texlive/trunk@45479 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/tlgs/Resource/Init/gs_init.ps | 173 ++++++++++++++++++++++++++--- 1 file changed, 157 insertions(+), 16 deletions(-) (limited to 'Master/tlpkg/tlgs/Resource') diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_init.ps b/Master/tlpkg/tlgs/Resource/Init/gs_init.ps index 620e7e03925..f6a89521bae 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_init.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_init.ps @@ -29,7 +29,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! -921 +922 % Check the interpreter revision. dup revision ne @@ -137,17 +137,16 @@ currentdict /PDFNOCIDFALLBACK known /PDFNOCIDFALLBACK exch def currentdict /BATCH known /BATCH exch def currentdict /DELAYBIND known /DELAYBIND exch def +currentdict /REALLYDELAYBIND known {/REALLYDELAYBIND true def /DELAYBIND true def}{/REALLYDELAYBIND false def}ifelse currentdict /DISKFONTS known /DISKFONTS exch def -currentdict /DOINTERPOLATE .knownget { /INTERPOLATE exch def } if +currentdict /DOINTERPOLATE .knownget { { -1 } { 0 } ifelse /InterpolateControl exch def } if currentdict /ESTACKPRINT known /ESTACKPRINT exch def currentdict /FAKEFONTS known /FAKEFONTS exch def currentdict /FIXEDMEDIA known /FIXEDMEDIA exch def currentdict /FIXEDRESOLUTION known /FIXEDRESOLUTION exch def currentdict /LOCALFONTS known /LOCALFONTS exch def currentdict /JOBSERVER known /JOBSERVER exch def -currentdict /NOBIND known /NOBIND exch def /.bind /bind load def -NOBIND { /bind { } def } if currentdict /NOCACHE known /NOCACHE exch def currentdict /NOCCFONTS known /NOCCFONTS exch def currentdict /NOCIE known /NOCIE exch def @@ -156,7 +155,7 @@ currentdict /NODISPLAY known not /DISPLAYING exch def currentdict /NOFONTMAP known /NOFONTMAP exch def currentdict /NOFONTPATH known /NOFONTPATH exch def currentdict /NOGC known /NOGC exch def -currentdict /NOINTERPOLATE .knownget { /INTERPOLATE exch not def } if +currentdict /NOINTERPOLATE .knownget { /InterpolateControl 0 def } if currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def currentdict /NOOUTERSAVE known /NOOUTERSAVE exch def currentdict /NOPAGEPROMPT known /NOPAGEPROMPT exch def @@ -170,12 +169,12 @@ currentdict /NOSUBSTDEVICECOLORS known /NOSUBSTDEVICECOLORS exch def currentdict /ORIENT1 known not { /ORIENT1 //true def } if currentdict /OSTACKPRINT known /OSTACKPRINT exch def currentdict /OUTPUTFILE known % obsolete -currentdict /WINKANJI known /WINKANJI exch def -currentdict /NOWINKANJI known /NOWINKANJI exch def { /OutputFile /OUTPUTFILE load def currentdict /OUTPUTFILE .undef } if currentdict /QUIET known /QUIET exch def +currentdict /WINKANJI known /WINKANJI exch def +currentdict /NOWINKANJI known /NOWINKANJI exch def % DELAYSAFER is effectively the same as newer NOSAFER currentdict /DELAYSAFER known { /DELAYSAFER //true def /NOSAFER //true def } if /SAFER currentdict /NOSAFER known { @@ -186,7 +185,6 @@ currentdict /DELAYSAFER known { /DELAYSAFER //true def /NOSAFER //true def } if } ifelse def currentdict /SHORTERRORS known /SHORTERRORS exch def -currentdict /STRICT known /STRICT exch def currentdict /TTYPAUSE known /TTYPAUSE exch def currentdict /WRITESYSTEMDICT known /WRITESYSTEMDICT exch def currentdict /RENDERTTNOTDEF known /RENDERTTNOTDEF exch def @@ -196,9 +194,11 @@ currentdict /SCANCONVERTERTYPE known } if % We rely on PSFitPage to actually implement EPSFitPage -currentdict /EPSFitPage known { /PSFitPage //true def } if +% But we need EPSCrop to be true, to actually issue a PageSize request, so set it here +% in case the user forgets. +currentdict /EPSFitPage known { /PSFitPage //true def /EPSCrop //true def} if % This is a "convenience" option that sets a combination of EPSFitPage, PDFFitPage and PSFitPage -currentdict /FitPage known { /EPSFitPage //true def /PDFFitPage //true def /PSFitPage //true def } if +currentdict /FitPage known { /EPSFitPage //true def /EPSCrop //true def /PDFFitPage //true def /PSFitPage //true def } if % Acquire environment variables. currentdict /DEVICE known not @@ -303,7 +303,7 @@ QUIET not { printgreeting flush } if } .bind odef % If we're delaying binding, remember everything that needs to be bound later. -DELAYBIND NOBIND not and +DELAYBIND { .currentglobal //false .setglobal systemdict /.delaybind 2000 array .forceput .setglobal @@ -1755,13 +1755,13 @@ currentdict /.runlibfile .undef { dup type /operatortype eq { % This might be a real operator, so bind might cause a typecheck, % but we've made the error a no-op temporarily. - .bind % do a real bind even if NOBIND is set + .bind } if pop pop } forall put } def -NOBIND DELAYBIND or not { .bindoperators } if +DELAYBIND not { .bindoperators } if % Establish a default environment. @@ -1885,7 +1885,10 @@ ifelse % Trap this and produce a reasonable error message. { setdevice } % does an erasepage INITDEBUG { exec //false } { .internalstopped } ifelse { - (**** Unable to open the initial device, quitting.) = flush 1 .quit + (%stderr) (w) file dup + (**** Unable to open the initial device, quitting.\n) writestring + flushfile + 1 .quit } if % If the media size is fixed, update the current page device dictionary. @@ -2112,6 +2115,118 @@ readonly def % If we are running in SAFER mode, lock things down SAFER { .setsafeglobal } if +/UndefinePostScriptOperators { + +%% This list is of Display PostScript operators. We believe that Display PostScript +%% was never fully implemented and the only known user, GNUStep, is no longer +%% using it. So lets remove it. +[ +/condition /currentcontext /detach /.fork /join /.localfork /lock /monitor /notify +/wait /yield /.currentscreenphase /.setscreenphase /.image2 /eoviewclip /initviewclip +/viewclip /viewclippath /defineusername +%% NeXT DPS extensions +/currentalpha /setalpha /.alphaimage /composite /compositerect /dissolve /sizeimagebox /.sizeimageparams +] +{systemdict exch .forceundef} forall + +%% This list is of operators which no longer appear to be used, and which we do not believe +%% to have any real use. For now we will undefine the operstors so they cannot easily be used +%% but can be easily restored (just delete the name from the list in the array). In future +%% we may remove the operator and the code implementation entirely. +[ +/.bitadd /.charboxpath /.cond /.countexecstack /.execstack /.runandhide /.popdevicefilter +/.execfile /.filenamesplit /.file_name_parent +/.setdefaultmatrix /.isprocfilter /.unread /.psstringencode +/.buildsampledfunction /.isencapfunction /.currentaccuratecurves /.currentcurvejoin /.currentdashadapt /.currentdotlength +/.currentlimitclamp /.dotorientation /.setaccuratecurves /.setcurvejoin /.setdashadapt /.setdotorientation +/.setlimitclamp /.currentscreenlevels /.dashpath /.pathbbox /.identeq /.identne /.tokenexec /.forgetsave /.pantonecallback + +%% Used by our own test suite files +%%/.setdotlength % Bug687720.ps +] +{systemdict exch .forceundef} forall + +%% This list of operators are used internally by various parts of the Ghostscript startup code. +%% Since each operator is a potential security vulnerability, and any operator listed here +%% is not required once the initislisation is complete and functions are bound, we undefine +%% the ones that aren't needed at runtime. +[ +/.callinstall /.callbeginpage /.callendpage +/.currentstackprotect /.setstackprotect /.errorexec /.finderrorobject /.installsystemnames /.bosobject /.fontbbox +/.type1execchar /.type2execchar /.type42execchar /.setweightvector /.getuseciecolor /processcolors /.includecolorspace +/.execn /.instopped /.stop /.stopped /.setcolorrendering /.setdevicecolorrendering /.buildcolorrendering1 /.builddevicecolorrendering1 +/.TransformPQR_scale_WB0 /.TransformPQR_scale_WB1 /.TransformPQR_scale_WB2 /.currentoverprintmode /.copydevice2 +/.devicename /.doneshowpage /flushpage /.getbitsrect /.getdevice /.getdefaultdevice /.getdeviceparams /.gethardwareparams +/makewordimagedevice /.outputpage /.putdeviceparams /.setdevice /.currentshowpagecount +/.setpagedevice /.currentpagedevice /.knownundef /.setmaxlength /.rectappend /.initialize_dsc_parser /.parse_dsc_comments +/.fillCIDMap /.fillIdentityCIDMap /.buildcmap /.filenamelistseparator /.libfile /.getfilename +/.file_name_combine /.file_name_is_absolute /.file_name_separator /.file_name_directory_separator /.file_name_current /.filename +/.peekstring /.writecvp /.subfiledecode /.setupUnicodeDecoder /.jbig2makeglobalctx /.registerfont /.parsecff +/.getshowoperator /.getnativefonts /.beginform /.endform /.get_form_id /.repeatform /.reusablestream /.rsdparams +/.buildfunction /.currentfilladjust2 /.setfilladjust2 /.sethpglpathmode /.currenthpglpathmode +/.currenthalftone /.sethalftone5 /.image1 /.imagemask1 /.image3 /.image4 +/.getiodevice /.getdevparms /.putdevparams /.bbox_transform /.matchmedia /.matchpagesize /.defaultpapersize +/.oserrno /.setoserrno /.oserrorstring /.getCPSImode +/.getscanconverter /.setscanconverter /.type1encrypt /.type1decrypt/.languagelevel /.setlanguagelevel /.eqproc /.fillpage /.buildpattern1 /.saslprep +/.buildshading1 /.buildshadin2 /.buildshading3 /.buildshading4 /.buildshading5 /.buildshading6 /.buildshading7 /.buildshadingpattern +/.argindex /.bytestring /.namestring /.stringbreak /.stringmatch /.globalvmarray /.globalvmdict /.globalvmpackedarray /.globalvmstring +/.localvmarray /.localvmdict /.localvmpackedarray /.localvmstring /.systemvmarray /.systemvmdict /.systemvmpackedarray /.systemvmstring /.systemvmfile /.systemvmlibfile +/.systemvmSFD /.settrapparams /.currentsystemparams /.currentuserparams /.getsystemparam /.getuserparam /.setsystemparams /.setuserparams +/.checkpassword /.locale_to_utf8 /.currentglobal /.gcheck /.imagepath + +% Used by our own test suite files +%/.fileposition %image-qa.ps +%/.makeoperator /.setCPSImode % gs_cet.ps + +% Either our code uses these in ways which mean they can't be undefined, or they are used directly by +% test files/utilities, or engineers expressed a desire to keep them visible. +% +%/currentdevice /.sort /.buildfont0 /.buildfont1 /.buildfont2 /.buildfont3 /.buildfont4 /.buildfont9 /.buildfont10 /.buildfont11 +%/.buildfotn32 /.buildfont42 /.type9mapcid /.type11mapcid /.swapcolors +%/currentdevice /.quit /.setuseciecolor /.needinput /.setoverprintmode /.special_op /.dicttomark /.knownget +%/.FAPIavailable /.FAPIpassfont /.FAPIrebuildfont /.FAPIBuildGlyph /.FAPIBuildChar /.FAPIBuildGlyph9 +%/.tempfile /.numicc_components /.set_outputintent /.max /.min /.shfill /.vmreclaim /.getpath /.setglobal +%/.setdebug /.mementolistnewblocks /getenv +] +{systemdict exch .forceundef} forall + +//systemdict /UndefinePostScriptOperators .forceundef +} bind def + +/UndefinePDFOperators { +%% This list of operators are used internally by various parts of the Ghostscript PDF interpreter. +%% Since each operator is a potential security vulnerability, and any operator listed here +%% is not required once the initislisation is complete and functions are bound, we undefine +%% the ones that aren't needed at runtime. +[ +/.pdfawidthshow /.pdfwidthshow /.currentblackptcomp /.setblackptcomp +/.setfillcolor /.setfillcolorspace /.setstrokecolor /.setstrokecolorspace /.currentrenderingintent /.setrenderingintent +/.currenttextrenderingmode /.settextspacing /.currenttextspacing /.settextleading /.currenttextleading +/.settextrise /.currenttextrise /.setwordspacing /.currentwordspacing /.settexthscaling /.currenttexthscaling +/.settextlinematrix /.currenttextlinematrix /.currenttextmatrix /.settextmatrix /.currentblendmode +/.currentopacityalpha /.currentshapealpha /.currenttextknockout +/.pushextendedgstate /.popextendedgstate /.begintransparencytextgroup +/.endtransparencytextgroup /.begintransparencymaskgroup /.begintransparencymaskimage /.endtransparencymask /.image3x +/.abortpdf14devicefilter /.pdfinkpath /.pdfFormName /.setstrokeconstantalpha +/.setfillconstantalpha /.setalphaisshape /.currentalphaisshape +/.settextspacing /.currenttextspacing /.settextleading /.currenttextleading /.settextrise /.currenttextrise +/.setwordspacing /.currentwordspacing /.settexthscaling /.currenttexthscaling + +% Used by our own test suite files +%/.pushpdf14devicefilter % transparency-example.ps +%/.poppdf14devicefilter % transparency-example.ps +%/.setopacityalpha % transparency-example.ps +%/.setshapealpha % transparency-example.ps +%/.endtransparencygroup % transparency-example.ps + +% undefining these causes errors/incorrect output +%/.settextrenderingmode /.setblendmode /.begintransparencygroup /.settextknockout /check_r6_password /.setstrokeoverprint /.setfilloverprint +%/.currentstrokeoverprint /.currentfilloverprint /.currentfillconstantalpha /.currentstrokeconstantalpha +] +{systemdict exch .forceundef} forall +//systemdict /UndefinePDFOperators .forceundef +} bind def + % If we delayed binding, make it possible to do it later. /.bindnow { currentuserparams /IdiomRecognition .knownget { @@ -2125,6 +2240,8 @@ SAFER { .setsafeglobal } if //systemdict /.delaybind {} .forceput % reclaim the space //systemdict /.bindnow .forceundef % ditto put +% //systemdict /UndefinePostScriptOperators get exec +% //systemdict /UndefinePDFOperators get exec //systemdict /.forcecopynew .forceundef % remove temptation //systemdict /.forcedef .forceundef % ditto //systemdict /.forceput .forceundef % ditto @@ -2240,6 +2357,13 @@ currentdict /.patterntypes .undef currentdict /.shadingtypes .undef currentdict /.wheredict .undef currentdict /.renderingintentdict .undef + +%% If we are using DELAYBIND we have to defer the undefinition +%% until .bindnow. +DELAYBIND not { + //systemdict /UndefinePostScriptOperators get exec + //systemdict /UndefinePDFOperators .forceundef +} if end % Clean up VM, and enable GC. Use .vmreclaim to force the GC. @@ -2252,11 +2376,28 @@ DELAYBIND not { systemdict /.forceput .undef % ditto systemdict /.forceundef .undef % ditto } if + +DELAYBIND REALLYDELAYBIND not and { +(\n *** WARNING - the DELAYBIND command has been deprecated, and will be\n) print +( removed in the next version. For now you can restore\n) print +( the behaviour by using -dREALLYDEALYBIND but if you\n) print +( require continued use of this command you should contact\n) print +( the Ghostscript developers. Commercial customers of\n) print +( Artifex should email their support contact, free users\n) print +( are encouraged to talk to us on the #ghostscript IRC\n) print +( channel on irc.freenode.net.\n\n) print +/DELAYBIND /undefined signalerror +} if + % Move superexec to internaldict if superexec is defined. -currentdict /superexec .knownget { +systemdict /superexec .knownget { 1183615869 internaldict /superexec 3 -1 roll put - currentdict /superexec .undef + systemdict /superexec .undef } if + +%% Can't remove this one until the last minute :-) +systemdict /.undef .undef + WRITESYSTEMDICT not { systemdict readonly pop } if (END GC) VMDEBUG -- cgit v1.2.3