home *** CD-ROM | disk | FTP | other *** search
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% utils.ps: PostScript procedures read in during startup, but %%
- %% which don't really need to be in init.ps itself %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- systemdict begin %% All of this goes in systemdict...
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Set up basic dictionary aliases %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /shareddict globaldict def
- /SharedFontDirectory GlobalFontDirectory def
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Start with a few universally useful things %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /binddef {
- bind def
- } bind def
-
- /exchdef {
- exch def
- } binddef
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Define `executive' and friends. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /prompt {(TPro> ) print flush} def
-
- /execdict <<
- /banner
- (Welcome to TPro version ) version
- 1 index length 1 index length add 1 add string
- dup 0 4 index putinterval
- dup 4 -1 roll length 4 -1 roll putinterval
- dup dup length 1 sub 10 put
- /copyright (Copyright (c) 1994-1996 TechPool Software, Inc.\n)
- dup 19 currentsystemparams /KernelBuild get
- dup length 4 sub 4 getinterval putinterval
- /execdepth 0
- /prompt {(TPro) print execdepth {(>) print} repeat ( ) print flush}
- /binary false
- /quitflag false
- /checkquit {quitflag {exit} if}
- >> def
-
- /executive {
- execdict begin
- execdepth 0 eq {
- true echo
- banner print copyright print
- flush
- } if
- /execdepth execdepth 1 add def
- end
- {
- execdict begin prompt end
- {(%statementedit) (r) file} stopped {pop pop exit} if
- {cvx exec} stopped {
- $error /newerror get not {exit} if
- errordict /handleerror get exec
- } if
- flush
- execdict begin checkquit end
- } loop
- execdict begin
- /execdepth execdepth 1 sub def
- execdepth 0 eq {
- (%%[ End of interactive mode ]%%\n) print flush
- } if
- end
- } binddef
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Define == and its dictionary %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /=print {=} def
-
- /=string 256 string def
-
- <<
- /rmargin 72
- /cp 3
- /NL (\n)
- /cvsprint {
- =string cvs tprint ( ) tprint
- } bind
-
- /linebreak {
- NL print /cp 0 def
- } bind
-
- /tprint {
- dup length cp add rmargin gt {
- NL print /cp 0 def
- }if
- dup length cp add /cp exch def
- print
- } bind
-
- /typeprint {
- dup type exec
- } bind
-
- /arraytype {
- dup rcheck {
- dup xcheck {
- ({) tprint {typeprint} forall (}) tprint
- } {
- ([) tprint {typeprint} forall (]) tprint
- } ifelse
- } {
- pop (-array- ) tprint
- } ifelse
- } bind
-
- /packedarraytype 1 index
-
- /stringtype{
- dup rcheck {
- (\() tprint tprint (\)) tprint
- } {
- pop (-string- ) tprint
- } ifelse
- } bind
-
- /nametype {
- dup xcheck not {
- (/) tprint
- } if
- cvsprint
- } bind
-
- /marktype {pop (-mark- ) tprint} bind
-
- /filetype {pop (-file- ) tprint} bind
-
- /dicttype {
- dup rcheck {
- dup length 0 eq {
- (<< >> ) tprint
- } {
- (<<) tprint linebreak
- {
- exch typeprint typeprint linebreak
- } forall
- (>> ) tprint
- } ifelse
- } {
- pop (-dictionary- ) tprint
- } ifelse
- } bind
-
- /nulltype {pop (-null- ) tprint} bind
-
- /booleantype {cvsprint}
-
- /realtype {cvsprint}
-
- /operatortype {cvsprint}
-
- /integertype {cvsprint}
-
- /fonttype {pop (-font- ) tprint} bind
-
- /savetype {pop (-save- ) tprint} bind
-
- /graphicsstatetype {pop (-graphicsstate- ) tprint} bind
-
- /canvastype {pop (-canvas- ) tprint} bind
-
- /processtype {pop (-process- ) tprint} bind
-
- >>
-
- {
- null begin
- /cp 0 def typeprint NL print
- end
- }
-
- dup 0 4 -1 roll put bind /== exchdef
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Some more useful printing procedures %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /stack {
- count 1 sub 0 1 3 -1 roll {
- index =
- } for
- } binddef
-
- /pstack {
- count 1 sub 0 1 3 -1 roll {
- index ==
- } for
- } binddef
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% The escape for Freehand v2 jobs which use setcolor. The %%
- %% interpreter calls this procedure if you execute setcolor in what %%
- %% looks like a Freehand v2 job. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /##_setcolor_## {
- dup length 4 eq {
- aload overprintprocess setcmykcolor
- } {
- aload 1 get spots exch get 5 get setinkoverprint setspotcolor
- } ifelse
- } binddef
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% A version of setcustomcolor which uses the /Separation colour %%
- %% space so as to let you produce the spot colour you asked for. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /findcmykcustomcolor {
- 5 array astore
- } binddef
-
- /setcustomcolorspace {
- mark /Separation 2 index 4 get
- /DeviceCMYK
- {dup 0 mul exch dup 0 mul exch dup 0 mul exch 0 mul}
- dup length array copy
- dup 1 7 index 0 get put
- dup 5 7 index 1 get put
- dup 9 7 index 2 get put
- dup 12 7 index 3 get put cvx
- ] setcolorspace
- pop
- } binddef
-
- /setcustomcolor {
- exch setcustomcolorspace setcolor
- } binddef
-
- %%/setseparationgray {
- %% currentcolorspace 0 get dup /DeviceGray ne {
- %% exch
- %% 1 exch sub
- %% exch
- %% } if
- %% /DeviceCMYK eq {
- %% dup dup dup
- %% } if
- %% setcolor
- %%} binddef
-
- /customcolorimage {
- setcustomcolorspace
- 10 dict begin
- /DataSource exch def
- /ImageMatrix exch def
- /BitsPerComponent exch def
- /Height exch def
- /Width exch def
- /ImageType 1 def
- /Decode [1 0] def
- currentdict end image
- } binddef
-
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% $fbf is an undocumented procedure which seems to be needed if %%
- %% the RIP provides makeblendedfont as an operator. I can't quite %%
- %% see why it's necessary, other than because the PostScript code %%
- %% assumes it's been defined. It certainly doesn't add any %%
- %% functionality. %%
- %% %%
- %% This may have been a PostScript printer driver bug, as I'm sure %%
- %% I've since seen code with $fbf that worked OK. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /$fbf {
- FontDirectory counttomark 3 add -1 roll known {
- cleartomark pop findfont
- } {
- ] exch findfont exch makeblendedfont
- dup /Encoding currentfont /Encoding get put definefont
- } ifelse
- currentfont /ScaleMatrix get makefont setfont
- } binddef
-
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% A procedure to render a PDF document from beginning to end. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /PDFrun {
- PDFfile
- dup 1 PDFpagebbox
- 4 2 roll pop pop 2 array astore << /PageSize 3 -1 roll >> setpagedevice
- 1 1 2 index PDFpagecount {
- 1 index exch PDFpage showpage
- } for
- pop
- } binddef
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% A veritable forest of paper sizes %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /A3 {<</PageSize [842 1190] /ImagingBBox null>> setpagedevice} binddef
- /a3 /A3 load def
- /A4 {<</PageSize [595 842] /ImagingBBox null>> setpagedevice} binddef
- /a4 /A4 load def
- /A5 {<</PageSize [421 595] /ImagingBBox null>> setpagedevice} binddef
- /a5 /A5 load def
- /B4 {<</PageSize [709 1001] /ImagingBBox null>> setpagedevice} binddef
- /b4 /B4 load def
- /B5 {<</PageSize [499 709] /ImagingBBox null>> setpagedevice} binddef
- /b5 /B5 load def
- /c5 {<</PageSize [459 649] /ImagingBBox null>> setpagedevice} binddef
- /com10 {<</PageSize [297 684] /ImagingBBox null>> setpagedevice} binddef
- /dl {<</PageSize [312 624] /ImagingBBox null>> setpagedevice} binddef
- /execu {<</PageSize [522 756] /ImagingBBox null>> setpagedevice} binddef
- /Legal {<</PageSize [612 1008] /ImagingBBox null>> setpagedevice} binddef
- /legal /Legal load def
- /Letter {<</PageSize [612 792] /ImagingBBox null>> setpagedevice} binddef
- /letter /Letter load def
- /monarch {<</PageSize [279 540] /ImagingBBox null>> setpagedevice} binddef
- /Note {<</PageSize [554 732] /ImagingBBox null>> setpagedevice} binddef
- /note /Note load def
- /11x17 {<</PageSize [792 1224] /ImagingBBox null>> setpagedevice} binddef
- /a4small {<</PageSize [595 842] /ImagingBBox [25 25 570 817]>> setpagedevice} binddef
- /lettersmall {<</PageSize [612 792] /ImagingBBox [25 25 587 767]>> setpagedevice} binddef
-
- %% Added for HP compatibility. C.C. - 2/26/96
- /lettertray {<< /PageSize [612 792] >> setpagedevice} def
-
- /setpage {statusdict begin setpage end} def
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Added to make processing EPSF files easier, per the instructions %%
- %% on p. 726 of the PLRM. C.C. - 2/26/96 %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /BeginEPSF
- {
- /b4_Inc_state save def
- /dict_count countdictstack def
- /op_count count 1 sub def
- userdict begin
- /showpage {} def
- 0 setgray 0 setlinecap
- 1 setlinewidth 0 setlinejoin
- 10 setmiterlimit [] 0 setdash newpath
- /languagelevel where
- {
- pop languagelevel
- 1 ne {false setstrokeadjust false setoverprint} if
- } if
- } bind def
-
- /EndEPSF
- {
- count op_count sub {pop} repeat
- countdictstack dict_count sub {end} repeat
- b4_Inc_state restore
- } bind def
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Added to make color accuracy better when rasterizing AI 1.1 %%
- %% files. C.C. - 2/26/96 %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- /setcmybcolor
- {
-
- % (Calling setcmybcolor.) = flush
-
- setcmykcolor
-
- } bind def
-
-
- end % systemdict
-
-
-