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/README.TEXLIVE | 2 +- Master/tlpkg/tlgs/Resource/Init/gs_init.ps | 173 ++++++- Master/tlpkg/tlgs/lib/cat.ps | 74 +++ Master/tlpkg/tlgs/lib/font2pcl.ps | 604 ++++++++++++++++++++++ Master/tlpkg/tlgs/lib/jobseparator.ps | 3 + Master/tlpkg/tlgs/lib/stcinfo.ps | 794 +++++++++++++++++++++++++++++ Master/tlpkg/tlgs/lib/stcolor.ps | 169 ++++++ 7 files changed, 1802 insertions(+), 17 deletions(-) create mode 100644 Master/tlpkg/tlgs/lib/cat.ps create mode 100644 Master/tlpkg/tlgs/lib/font2pcl.ps create mode 100644 Master/tlpkg/tlgs/lib/jobseparator.ps create mode 100644 Master/tlpkg/tlgs/lib/stcinfo.ps create mode 100644 Master/tlpkg/tlgs/lib/stcolor.ps (limited to 'Master/tlpkg/tlgs') diff --git a/Master/tlpkg/tlgs/README.TEXLIVE b/Master/tlpkg/tlgs/README.TEXLIVE index 8358312554a..3cf0f45e201 100644 --- a/Master/tlpkg/tlgs/README.TEXLIVE +++ b/Master/tlpkg/tlgs/README.TEXLIVE @@ -22,7 +22,7 @@ Changes: * A cidfmap file supporting CJK fonts provided by Windows XP and newer releases as well as the Japanese IPA fonts was added. - * kanji directory copied from w23tex. + * kanji directory copied from w32tex. * Binaries compiled by Akira Kakuto with --disable-compile-inits. 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 diff --git a/Master/tlpkg/tlgs/lib/cat.ps b/Master/tlpkg/tlgs/lib/cat.ps new file mode 100644 index 00000000000..1dec040db76 --- /dev/null +++ b/Master/tlpkg/tlgs/lib/cat.ps @@ -0,0 +1,74 @@ +% Copyright (C) 2001-2012 Artifex Software, Inc. +% All Rights Reserved. +% +% This software is provided AS-IS with no warranty, either express or +% implied. +% +% This software is distributed under license and may not be copied, +% modified or distributed except as expressly authorized under the terms +% of the license contained in the file LICENSE in this distribution. +% +% Refer to licensing information at http://www.artifex.com or contact +% Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, +% CA 94903, U.S.A., +1(415)492-9861, for further information. +% +% +% $Id: cat.ps 8331 2008-02-05 11:07:00Z kens $ +% +% Appends one file to another. Primarily used to overcome the +% 'copy' limitation of Windows command shell for ps2epsi +% +% the files to be appended are given by the environament +% variables %infile% and %outfile%. %infile% is appended to +% %outfile% +% + +/datastring 1024 string def + +{ + (outfile) getenv + { + /outfilename exch def + (infile) getenv + { + /infilename exch def + + infilename status + { + pop pop pop pop outfilename status + { + pop pop pop pop + infilename (r) file /infile exch def + outfilename (a+) file /outfile exch def + { + infile datastring readstring + { + outfile exch writestring + } + { + dup length 0 gt + {outfile exch writestring} {pop} ifelse + exit + } ifelse + } loop + infile closefile + outfile closefile + } + { + (Failed to find file ) print outfilename == + } ifelse + } + { + (Failed to find file ) print infilename == + } ifelse + } + { + (Couldn't find %infile% environment variable) == + } ifelse + } + { + (Couldn't find %outfile% environment variable) == + } + ifelse +} bind +exec diff --git a/Master/tlpkg/tlgs/lib/font2pcl.ps b/Master/tlpkg/tlgs/lib/font2pcl.ps new file mode 100644 index 00000000000..bf0c903d6b1 --- /dev/null +++ b/Master/tlpkg/tlgs/lib/font2pcl.ps @@ -0,0 +1,604 @@ +% Copyright (C) 2001-2012 Artifex Software, Inc. +% All Rights Reserved. +% +% This software is provided AS-IS with no warranty, either express or +% implied. +% +% This software is distributed under license and may not be copied, +% modified or distributed except as expressly authorized under the terms +% of the license contained in the file LICENSE in this distribution. +% +% Refer to licensing information at http://www.artifex.com or contact +% Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, +% CA 94903, U.S.A., +1(415)492-9861, for further information. +% + +% font2pcl.ps +% Write out a font as a PCL bitmap font. + +/pcldict 60 dict def + +% Write out the current font as a PCL bitmap font. +% The current transformation matrix defines the font size and orientation. + +/WriteResolution? false def % true=use "resolution bound font" format, + % false=use older format + +/LJ4 false def % true=use LJ4 Typeface code + % false=use LJIIP/IID/IIIx Typeface code + +pcldict begin % internal procedures + +/findstring % findstring + { search { pop pop pop true } { pop false } ifelse + } def + + % Determine which set of keywords is present in a string. + % The last keyword set must be empty. + +/keysearch % keysearch + { 0 1 2 index length 1 sub + { 2 copy get true exch + { % Stack: + 4 index exch findstring and + } + forall + { 0 exch getinterval exit + } + if pop + } + for + exch pop length % invalid index if missing + } def + + % Determine the device height of a string in quarter-dots. + +/charheight % charheight + { gsave newpath 0 0 moveto false charpath + pathbbox exch pop exch sub exch pop 0 exch grestore + dtransform add abs 4 mul cvi + } def + + % Compute an integer version of the transformed FontBBox. + +/inflate % inflate + { dup 0 gt { ceiling } { floor } ifelse + } def +/ixbbox % - ixbbox + { /FontBBox load aload pop % might be executable or literal + 4 2 roll transform exch truncate cvi exch truncate cvi + 4 2 roll transform exch inflate cvi exch inflate cvi + } def + + % Determine the original font of a possibly transformed font. + % Since some badly behaved PostScript files construct transformed + % fonts "by hand", we can't just rely on the OrigFont pointers. + % Instead, if a font with the given name exists, and if its + % entries for FontType and UniqueID match those of the font we + % obtain by following the OrigFont chain, we use that font. + +/origfont + { { dup /OrigFont known not { exit } if /OrigFont get } loop + FontDirectory 1 index /FontName get .knownget + { % Stack: origfont namedfont + 1 index /FontType get 1 index /FontType get eq + { 1 index /UniqueID .knownget + { 1 index /UniqueID .knownget + { eq { exch } if } + { pop } + ifelse + } + if + } + if pop + } + if + } def + + % Determine the bounding box of the current device's image. + % Free variables: row, zerow. + +/devbbox % devbbox + { % Find top and bottom whitespace. + dup + { dup 0 eq { exit } if 1 sub + dup currentdevice exch row copyscanlines + zerow ne { 1 add exit } if + } + loop % ymax1 + 0 + { 2 copy eq { exit } if + dup currentdevice exch row copyscanlines + zerow ne { exit } if + 1 add + } + loop % ymin + exch + % Find left and right whitespace. + 3 index 0 + % Stack: rw rh ymin ymax1 xmin xmax1 + 3 index 1 4 index 1 sub + { currentdevice exch row copyscanlines .findzeros + exch 4 1 roll .max 3 1 roll .min exch + } + for % xmin xmax1 + % Special check: xmin > xmax1 if height = 0 + 2 copy gt { exch pop dup } if + 6 -2 roll pop pop + + } def + + % Write values on outfile. + + /w1 { 255 and outfile exch write } def + /w2 { dup -8 bitshift w1 w1 } def + /wbyte %