From c4e7da3bbefa16d0bc77cd1e5a77e748a54177ce Mon Sep 17 00:00:00 2001 From: Reinhard Kotucha Date: Tue, 4 Sep 2018 22:33:58 +0000 Subject: Upgrade gs-9.23 -> gs-9.24 git-svn-id: svn://tug.org/texlive/trunk@48582 c570f23f-e606-0410-a88d-b1316a301751 --- Master/source/ghostscript-9.23.tar.xz | Bin 33426160 -> 0 bytes Master/source/ghostscript-9.24.tar.xz | Bin 0 -> 33015704 bytes Master/tlpkg/tlgs/README.TEXLIVE | 4 +- Master/tlpkg/tlgs/Resource/Init/gs_dps.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_init.ps | 338 +++++++------ Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps | 58 ++- Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps | 7 +- Master/tlpkg/tlgs/Resource/Init/gs_pdfwr.ps | 7 +- Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps | 6 +- Master/tlpkg/tlgs/Resource/Init/gs_typ32.ps | 2 +- Master/tlpkg/tlgs/Resource/Init/pdf_base.ps | 152 ++++-- Master/tlpkg/tlgs/Resource/Init/pdf_draw.ps | 738 ++++++++++++++++------------ Master/tlpkg/tlgs/Resource/Init/pdf_font.ps | 154 +++--- Master/tlpkg/tlgs/Resource/Init/pdf_main.ps | 432 ++++++++-------- Master/tlpkg/tlgs/Resource/Init/pdf_ops.ps | 377 +++++++------- Master/tlpkg/tlgs/Resource/Init/pdf_rbld.ps | 22 +- Master/tlpkg/tlgs/Resource/Init/pdf_sec.ps | 50 +- Master/tlpkg/tlgs/bin/gsdll32.dll | Bin 8008192 -> 8147968 bytes Master/tlpkg/tlgs/bin/gsdll32.lib | Bin 8470 -> 8470 bytes Master/tlpkg/tlgs/bin/gswin32.exe | Bin 140800 -> 140800 bytes Master/tlpkg/tlgs/bin/gswin32c.exe | Bin 132096 -> 132096 bytes 22 files changed, 1313 insertions(+), 1038 deletions(-) delete mode 100644 Master/source/ghostscript-9.23.tar.xz create mode 100644 Master/source/ghostscript-9.24.tar.xz diff --git a/Master/source/ghostscript-9.23.tar.xz b/Master/source/ghostscript-9.23.tar.xz deleted file mode 100644 index a36a5a99825..00000000000 Binary files a/Master/source/ghostscript-9.23.tar.xz and /dev/null differ diff --git a/Master/source/ghostscript-9.24.tar.xz b/Master/source/ghostscript-9.24.tar.xz new file mode 100644 index 00000000000..e7c8735adcf Binary files /dev/null and b/Master/source/ghostscript-9.24.tar.xz differ diff --git a/Master/tlpkg/tlgs/README.TEXLIVE b/Master/tlpkg/tlgs/README.TEXLIVE index 58d4e48bf8d..d730a9a031c 100644 --- a/Master/tlpkg/tlgs/README.TEXLIVE +++ b/Master/tlpkg/tlgs/README.TEXLIVE @@ -1,12 +1,12 @@ -This directory contains a subset of the Ghostscript 9.23 distribution +This directory contains a subset of the Ghostscript 9.24 distribution for Windows. The only purpose of this package is to support programs shipped with TeX Live. It's not intended for general use. Changes: * The directories "doc", "examples", "libpng", "trio", "zlib", - "openjpeg", and "lcms2art" were removed. + "openjpeg", and "lcms2{art,mt}" were removed. * All executable files except Ghostscript itself were removed. diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_dps.ps b/Master/tlpkg/tlgs/Resource/Init/gs_dps.ps index 3ebd0a33172..cad7056230d 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_dps.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_dps.ps @@ -70,7 +70,7 @@ % Save a copy of the initial gstate. //systemdict /savedinitialgstate gstate readonly .forceput .setglobal -} .bind def +} .bind executeonly def % must be bound and hidden for .forceput % Initialize local dictionaries and gstate when creating a new context. % Note that until this completes, we are in the anomalous situation of diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps b/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps index 0f7c3153a7b..3ceee18d396 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_fntem.ps @@ -408,7 +408,7 @@ currentdict end def exit } loop exch setglobal -} bind def +} .bind executeonly def % must be bound and hidden for .forceput currentdict end /ProcSet defineresource pop diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_init.ps b/Master/tlpkg/tlgs/Resource/Init/gs_init.ps index 6c8da532ca0..cac0e37c239 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! -923 +924 % Check the interpreter revision. dup revision ne @@ -767,23 +767,6 @@ userdict /.currentresourcefile //null put { /run .systemvar exec } .execasresource } bind def -% Define procedures for getting and setting the current device resolution. - -/gsgetdeviceprop % gsgetdeviceprop - { 2 copy mark exch //null .dicttomark .getdeviceparams - dup mark eq % if true, not found - { pop dup /undefined signalerror } - { 5 1 roll pop pop pop pop } - ifelse - } bind def -/gscurrentresolution % - gscurrentresolution <[xres yres]> - { currentdevice /HWResolution gsgetdeviceprop - } bind def -/gssetresolution % <[xres yres]> gssetresolution - - { 2 array astore mark exch /HWResolution exch - currentdevice copydevice putdeviceprops setdevice - } bind def - % Define auxiliary procedures needed for the above. /shellarguments % -> shell_arguments true (or) false { /ARGUMENTS where @@ -1521,6 +1504,14 @@ setpacking dup 150 lt //systemdict /DITHERPPI known not and } bind def +/.gsgetdeviceprop % gsgetdeviceprop + { 2 copy mark exch //null .dicttomark .getdeviceparams + dup mark eq % if true, not found + { pop dup /undefined signalerror } + { 5 1 roll pop pop pop pop } + ifelse + } bind def + % The following implementation uses LL2 extensions, but only in stopped % contexts so that with LL1, the .set??reshalftone will be used. % @@ -1528,7 +1519,7 @@ setpacking % false /.getdefaulthalftone { % try the device to see if it has a default halftone - { currentdevice /HalftoneDefault gsgetdeviceprop } .internalstopped + { currentdevice /HalftoneDefault //.gsgetdeviceprop exec } .internalstopped { pop pop //false } % no device property { dup type /dicttype eq { //true } { pop //false } ifelse } ifelse @@ -1541,6 +1532,7 @@ setpacking } if } bind def +currentdict /.gsgetdeviceprop .forceundef /.setdefaulthalftone { .getdefaulthalftone @@ -2012,15 +2004,30 @@ systemdict /EPSBoundingBoxInit known { EPSBoundingBoxInit } if .currentglobal //true .setglobal /SAFETY 2 dict dup /safe //false put - dup /tempfiles 10 dict readonly put + dup /tempfiles 10 dict noaccess put readonly def .setglobal +/tempfilepaths +[ + (TMPDIR) getenv not + { + (TEMP) getenv not + { + (TMP) getenv not + { + (/temp) (/tmp) + } if + } if + } if +] def + /.locksafe_userparams { SAFETY /safe get not { << /PermitFileReading [ currentuserparams /PermitFileReading get aload pop + //tempfilepaths aload pop /FONTPATH .systemvar (*) .generate_dir_list_templates % Library files : /LIBPATH .systemvar (*) .generate_dir_list_templates @@ -2036,12 +2043,22 @@ readonly def concatstrings concatstrings .generate_dir_list_templates } if ] + /PermitFileWriting [ + currentuserparams /PermitFileWriting get aload pop + //tempfilepaths aload pop + ] + /PermitFileControl [ + currentuserparams /PermitFileControl get aload pop + //tempfilepaths aload pop + ] /LockFilePermissions //true >> setuserparams } if } bind def +currentdict /tempfilepaths undef + /.locksafe { .locksafe_userparams systemdict /getenv {pop //false} .forceput @@ -2103,151 +2120,145 @@ readonly def .locksafeglobal } bind executeonly odef -/deletefile { - dup { deletefile } stopped { - pop //deletefile $error /errorname get signalerror - } { - % deletefile succeeded. Remove from tempfile list if present - //SAFETY /tempfiles get exch cvn 2 copy known { - .forceundef - } { - pop pop - } - ifelse - } - ifelse -} .bind executeonly odef - -% If a file is opened with .tempfile with SAFER not (yet) set, -% the file can be deleted later, even if SAFER is set. -/.tempfile { - .tempfile % filename file - //SAFETY /tempfiles get 2 .argindex //true .forceput -} .bind executeonly odef - % If we are running in SAFER mode, lock things down SAFER { .setsafeglobal } if +/SAFERUndefinePostScriptOperators { + [ + % 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 + /.setdotlength % Bug687720.ps + /.sort /.setdebug /.mementolistnewblocks /getenv + + /.makeoperator /.setCPSImode % gs_cet.ps, this won't work on cluster with -dSAFER + + /unread + ] + {systemdict exch .forceundef} forall + + //systemdict /SAFERUndefinePostScriptOperators .forceundef +} .bind executeonly def % must be bound and hidden for .forceundef + /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 /.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 a free user in the Library of Congress. Apparently this is used to -% draw a partial page, which is then filled in by the results of a barcode -% scanner and SQL database lookup. Its not clear to us exactly why this needs to be -% done as a partial page, but its easiest to restore the operator, and it seems like -% its a reasonably safe operator to restore, for the *very* few devices on which -% it will have any effect. Currently this uses the 'sync_outptu' device method -% to transfer the partial page, in future we may use a spec_op instead. -%/flushpage - -% 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 + %% 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 /.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 /.buildshading2 /.buildshading3 /.buildshading4 /.buildshading5 /.buildshading6 /.buildshading7 /.buildshadingpattern + /.shfill /.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 a free user in the Library of Congress. Apparently this is used to + % draw a partial page, which is then filled in by the results of a barcode + % scanner and SQL database lookup. Its not clear to us exactly why this needs to be + % done as a partial page, but its easiest to restore the operator, and it seems like + % its a reasonably safe operator to restore, for the *very* few devices on which + % it will have any effect. Currently this uses the 'sync_outptu' device method + % to transfer the partial page, in future we may use a spec_op instead. + %/flushpage + + % 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 /.vmreclaim /.getpath /.setglobal + %/.setdebug /.mementolistnewblocks /getenv + ] + {systemdict exch .forceundef} forall + + //systemdict /UndefinePostScriptOperators .forceundef +} .bind executeonly def % must be bound and hidden for .forceundef /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 /.setPDFfontsize /.currentPDFfontsize - -% 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 + %% 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. + %% This function is only called if DELAYBIND is true. It is a copy of the code at the end of pdf_main.ps + %% and must be maintained in parallel with it. + [ + /.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 /.setPDFfontsize /.currentPDFfontsize + /.setdistillerparams + + % 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 executeonly def % must be bound and hidden for .forceundef % If we delayed binding, make it possible to do it later. /.bindnow { @@ -2262,8 +2273,11 @@ SAFER { .setsafeglobal } if //systemdict /.delaybind {} .forceput % reclaim the space //systemdict /.bindnow .forceundef % ditto put -% //systemdict /UndefinePostScriptOperators get exec -% //systemdict /UndefinePDFOperators get exec + SAFER { + //systemdict /SAFERUndefinePostScriptOperators get exec + } if + //systemdict /UndefinePostScriptOperators get exec + //systemdict /UndefinePDFOperators get exec //systemdict /.forcecopynew .forceundef % remove temptation //systemdict /.forcedef .forceundef % ditto //systemdict /.forceput .forceundef % ditto @@ -2375,6 +2389,9 @@ currentdict /.renderingintentdict .undef %% If we are using DELAYBIND we have to defer the undefinition %% until .bindnow. DELAYBIND not { + SAFER { + //systemdict /SAFERUndefinePostScriptOperators get exec + } if //systemdict /UndefinePostScriptOperators get exec //systemdict /UndefinePDFOperators .forceundef } if @@ -2385,6 +2402,7 @@ end { pop NOGC not { 2 .vmreclaim 0 vmreclaim } if } if DELAYBIND not { + systemdict /.bindnow .undef % We only need this for DELAYBIND systemdict /.forcecopynew .undef % remove temptation systemdict /.forcedef .undef % ditto systemdict /.forceput .undef % ditto diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps b/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps index 72c11edb4a1..eee0b9f6175 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_lev2.ps @@ -163,7 +163,8 @@ end % Set them again to the new values. From here on, we are safe, % since a context switch will consult userparams. .setuserparams -} .bind def +} .bind executeonly def % must be bound and hidden for .forceput + /setuserparams { % setuserparams - .setuserparams2 } .bind odef @@ -1072,10 +1073,10 @@ def % the values given into an array. This is consistent with what we see when % testing with Adobe Distiller 6.0. % findcmykcustomcolor -/findcmykcustomcolor { 5 array astore } bind def +/findcmykcustomcolor { 5 array astore } bind executeonly 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 def +/findrgbcustomcolor { 4 array astore } bind executeonly 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 +1105,7 @@ def ] } ifelse cvx bind exch pop % Make executable and remove the input array -} bind def +} bind executeonly def % Construct the colorspace array to be used by setcolorspace from the array % result of either findcmykcustomcolor or findrgbcustomcolor. @@ -1124,7 +1125,7 @@ def ] } ifelse exch pop % remove the input array -} bind def +} bind executeonly 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 @@ -1133,14 +1134,51 @@ def % for some reason, so an alternate operational mode is tolerated: % null setcustomcolor - /setcustomcolor % setcustomcolor - -{ dup //null ne { +{ + dup //null eq { + pop pop + }{ + % Check that the tint is a number between 0 and 1 + dup type dup /integertype eq exch /realtype eq or not { + /setcustomcolor /typecheck cvx signalerror + } if + dup 1 le not { + /setcustomcolor /rangecheck cvx signalerror + } if + dup 0 ge not { + /setcustomcolor /rangecheck cvx signalerror + } if + + % The array is supposed to be the result of fundcmykcustomcolor. Our + % implementation just pushes all the arguments into the array and that's + % what buildcolorspacearray expects. So check that now. + % Starting with the first N-1 elemenst which must be numbers where 0 <= x <= 1 + 1 index + 0 1 2 index length 2 sub + { + 1 index exch get dup + type dup /integertype eq exch /realtype eq or not { + /setcustomcolor /typecheck cvx signalerror + } if + dup + 1 le not { + /setcustomcolor /rangecheck cvx signalerror + } if + 0 ge not { + /setcustomcolor /rangecheck cvx signalerror + } if + } for + + % Finally, check the last element of the array, which must be a string. + dup length 1 sub get type /stringtype eq not { + /setcustomcolor /typecheck cvx signalerror + } if + exch //buildcolorspacearray exec setcolorspace % Set the Separation color space as current setcolor % Set the tint as the current color - } - { pop pop } % 'null' as the tint is ignored. pop tint and array - ifelse -} bind def + } ifelse +} bind executeonly 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 diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps b/Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps index 5aa56a36833..1d37e536165 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_ll3.ps @@ -440,6 +440,11 @@ systemdict /.reuseparamdict mark /shfill .systemvar /undefined signalerror } ifelse } bind def + +/.buildshading_and_shfill { + .buildshading .shfill +} bind def + systemdict /.reuseparamdict undef /.buildpattern2 { %