# HG changeset patch # User Richard Lowe # Date 1301861618 14400 # Node ID de6c57673fcca0a3a3212b18dea9b0f672fcb2d0 # Parent 30ca6bbf5b098623b25386f8c2153e13012bec4a 854 postscript filter EOF missed some bits Reviewed by: garrett@nexent.com Reviewed by: gwr@nexenta.com Approved by: garrett@nexenta.com diff -r 30ca6bbf5b09 -r de6c57673fcc usr/src/cmd/lp/filter/postscript/README --- a/usr/src/cmd/lp/filter/postscript/README Sun Apr 03 16:13:38 2011 -0400 +++ b/usr/src/cmd/lp/filter/postscript/README Sun Apr 03 16:13:38 2011 -0400 @@ -202,32 +202,6 @@ pic -T720 | tbl | eqn -r720 | troff -mm -Tpost | dpost >file.ps -postbgi - Translates BGI (Basic Graphical Instruction) files into PostScript. The - default line width, as with posttek, is one pixel, which probably won't - produce acceptable results on write-white engines, like the ones used in - the QMS PS-2400 or Dataproducts 2665. The -w option can be used to set a - new line width. For a different default change the definition of linewidth - in postscript/postbgi.ps. - - Support for PRISM (ie. color BGI) jobs has been included, although what - you get by default may not be acceptable, at least not on the ColorScript - 100. A simple solution is add the -P"/prism true def" option to the postbgi - command line when you're translating PRISM jobs. In fact nothing breaks if - you include the -P"/prism true def" option when translating STARE (black - and white BGI) jobs. The only difference most users will notice is that - plots are smaller than normal. - - EXAMPLES: - - For normal STARE jobs, scaled to almost fill a page, use - - postbgi file >file.ps - - while most PRISM jobs require, - - postbgi -P"/prism true" file >file.ps - postprint Translates ASCII files into PostScript. diff -r 30ca6bbf5b09 -r de6c57673fcc usr/src/cmd/lp/filter/postscript/common/path.h --- a/usr/src/cmd/lp/filter/postscript/common/path.h Sun Apr 03 16:13:38 2011 -0400 +++ b/usr/src/cmd/lp/filter/postscript/common/path.h Sun Apr 03 16:13:38 2011 -0400 @@ -22,32 +22,21 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6 */ /* - * * pathname definitions for important files and directories. - * */ -#define DPOST "/usr/lib/lp/postscript/dpost.ps" -#define POSTBGI "/usr/lib/lp/postscript/postbgi.ps" -#define POSTDAISY "/usr/lib/lp/postscript/postdaisy.ps" -#define POSTDMD "/usr/lib/lp/postscript/postdmd.ps" -#define POSTMD "/usr/lib/lp/postscript/postmd.ps" -#define POSTPLOT "/usr/lib/lp/postscript/postplot.ps" -#define POSTPRINT "/usr/lib/lp/postscript/postprint.ps" -#define POSTTEK "/usr/lib/lp/postscript/posttek.ps" +#define DPOST "/usr/lib/lp/postscript/dpost.ps" +#define POSTPRINT "/usr/lib/lp/postscript/postprint.ps" -#define BASELINE "/usr/lib/lp/postscript/baseline.ps" -#define COLOR "/usr/lib/lp/postscript/color.ps" -#define DRAW "/usr/lib/lp/postscript/draw.ps" -#define FORMFILE "/usr/lib/lp/postscript/forms.ps" -#define KERNING "/usr/lib/lp/postscript/kerning.ps" -#define REQUESTFILE "/usr/lib/lp/postscript/ps.requests" +#define BASELINE "/usr/lib/lp/postscript/baseline.ps" +#define COLOR "/usr/lib/lp/postscript/color.ps" +#define DRAW "/usr/lib/lp/postscript/draw.ps" +#define FORMFILE "/usr/lib/lp/postscript/forms.ps" +#define KERNING "/usr/lib/lp/postscript/kerning.ps" +#define REQUESTFILE "/usr/lib/lp/postscript/ps.requests" -#define HOSTFONTDIR "/usr/share/lib/hostfontdir" -#define FONTDIR "/usr/lib/font" -#define TEMPDIR "/tmp" - +#define HOSTFONTDIR "/usr/share/lib/hostfontdir" +#define FONTDIR "/usr/lib/font" +#define TEMPDIR "/tmp" diff -r 30ca6bbf5b09 -r de6c57673fcc usr/src/cmd/lp/filter/postscript/postscript/README --- a/usr/src/cmd/lp/filter/postscript/postscript/README Sun Apr 03 16:13:38 2011 -0400 +++ b/usr/src/cmd/lp/filter/postscript/postscript/README Sun Apr 03 16:13:38 2011 -0400 @@ -23,35 +23,9 @@ Prologues and a few other PostScript files that are copied to /usr/lib/postscript (ie. LIBDIR in ../Makefile) when you do an install. -Default settings for things like the linewidth in posttek and postbgi, have been -moved to these files. All can be changed without requiring a recompilation of any -programs supplied with this package. In addition all the translators understand -the -P option that lets you pass arbitrary PostScript through to the output file. -The option can be useful if you want to change parameters that are defined in -the prologue but not tied to specific command line options. - -For example, the DMD bitmap translator (postdmd) that assumes a screen resolution -of 100 dpi. screenres is set to 100 in postdmd.ps, but there's no explicit option -to change it. If the bitmap resolution happened to be 300 dpi typing either, - - postdmd -P"/screenres 300 def" file - -or, - - postdmd -P"/screenres 300" file - -sets screenres to 300. In the first case the definition is made immediately after -the prologue, while in the second it's made when procedure setup is executed. - -Another example is postbgi.ps, which can be used as the prologue for both STARE -and PRISM jobs. Although STARE (black and white) and PRISM (color) jobs are both -written in BGI, experience shows that PRISM jobs are often fundamentally different -and often require device specific tuning that's rarely needed for STARE jobs. The -prologue (postbgi.ps) defines a boolean called prism (initialized to false) while -the command line, - - postbgi -P"/prism true" file >file.ps - -sets prism to true. What you end up getting is the device specific tuning needed -for most PRISM jobs. - +Default settings have been moved to these files. All can be changed without +requiring a recompilation of any programs supplied with this package. In +addition all the translators understand the -P option that lets you pass +arbitrary PostScript through to the output file. The option can be useful if +you want to change parameters that are defined in the prologue but not tied to +specific command line options. diff -r 30ca6bbf5b09 -r de6c57673fcc usr/src/cmd/lp/filter/postscript/postscript/postdaisy.ps --- a/usr/src/cmd/lp/filter/postscript/postscript/postdaisy.ps Sun Apr 03 16:13:38 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -%ident "@(#)lp:filter/postscript/postscript/postdaisy.ps 1.1" -% -% CDDL HEADER START -% -% The contents of this file are subject to the terms of the -% Common Development and Distribution License, Version 1.0 only -% (the "License"). You may not use this file except in compliance -% with the License. -% -% You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -% or http://www.opensolaris.org/os/licensing. -% See the License for the specific language governing permissions -% and limitations under the License. -% -% When distributing Covered Code, include this CDDL HEADER in each -% file and include the License file at usr/src/OPENSOLARIS.LICENSE. -% If applicable, add the following below this CDDL HEADER, with the -% fields enclosed by brackets "[]" replaced with your own identifying -% information: Portions Copyright [yyyy] [name of copyright owner] -% -% CDDL HEADER END -% -% -% Version 3.15 prologue for Diablo 1640 files. -% - -/#copies 1 store -/aspectratio 1 def -/font /Courier def -/formsperpage 1 def -/hmi 12 def -/landscape false def -/magnification 1 def -/margin 10 def -/orientation 0 def -/resolution 240 def -/xoffset .25 def -/yoffset -0.25 def - -/roundpage true def -/useclippath true def -/pagebbox [0 0 612 792] def - -/inch {72 mul} bind def -/min {2 copy gt {exch} if pop} bind def - -/setup { - counttomark 2 idiv {def} repeat pop - - landscape {/orientation 90 orientation add def} if - /scaling 72 resolution div def - currentdict /pointsize known not {/pointsize hmi def} if - font findfont pointsize scaling div scalefont setfont - /charwidth (M) stringwidth pop def - - pagedimensions - xcenter ycenter translate - orientation neg rotate - width 2 div neg height 2 div translate - xoffset inch yoffset inch translate - margin 2 div dup neg translate - magnification dup aspectratio mul scale - height width div 1 min dup scale - scaling dup scale -} def - -/pagedimensions { - useclippath userdict /gotpagebbox known not and { - /pagebbox [clippath pathbbox newpath] def - roundpage currentdict /roundpagebbox known and {roundpagebbox} if - } if - pagebbox aload pop - 4 -1 roll exch 4 1 roll 4 copy - landscape {4 2 roll} if - sub /width exch def - sub /height exch def - add 2 div /xcenter exch def - add 2 div /ycenter exch def - userdict /gotpagebbox true put -} def - -/pagesetup {/page exch def 0 0 moveto} bind def - -/t { - charwidth sub /advance exch def - neg /y exch def - counttomark 2 idiv {y moveto advance 0 3 -1 roll ashow} repeat -} bind def - -/f {findfont pointsize scaling div scalefont setfont} bind def - -/done {/lastpage where {pop lastpage} if} def diff -r 30ca6bbf5b09 -r de6c57673fcc usr/src/cmd/lp/filter/postscript/postscript/postdmd.ps --- a/usr/src/cmd/lp/filter/postscript/postscript/postdmd.ps Sun Apr 03 16:13:38 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -%ident "@(#)lp:filter/postscript/postscript/postdmd.ps 1.1" -% -% CDDL HEADER START -% -% The contents of this file are subject to the terms of the -% Common Development and Distribution License, Version 1.0 only -% (the "License"). You may not use this file except in compliance -% with the License. -% -% You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -% or http://www.opensolaris.org/os/licensing. -% See the License for the specific language governing permissions -% and limitations under the License. -% -% When distributing Covered Code, include this CDDL HEADER in each -% file and include the License file at usr/src/OPENSOLARIS.LICENSE. -% If applicable, add the following below this CDDL HEADER, with the -% fields enclosed by brackets "[]" replaced with your own identifying -% information: Portions Copyright [yyyy] [name of copyright owner] -% -% CDDL HEADER END -% -% -% Version 3.15 prologue for DMD bitmap files. -% - -/#copies 1 store -/aspectratio 1 def -/formsperpage 1 def -/landscape false def -/magnification 1 def -/margin 0 def -/orientation 0 def -/screenres 100 def -/xoffset 0 def -/yoffset 0 def - -/useclippath true def -/pagebbox [0 0 612 792] def - -/inch {72 mul} bind def -/min {2 copy gt {exch} if pop} bind def - -/setup { - counttomark 2 idiv {def} repeat pop - - landscape {/orientation 90 orientation add def} if - - pagedimensions - xcenter ycenter translate - orientation neg rotate - xoffset inch yoffset inch translate - magnification dup aspectratio mul scale - - /height height margin sub def - /width width margin sub def -} def - -/pagedimensions { - useclippath { - /pagebbox [clippath pathbbox newpath] def - } if - pagebbox aload pop - 4 -1 roll exch 4 1 roll 4 copy - landscape {4 2 roll} if - sub /width exch def - sub /height exch def - add 2 div /xcenter exch def - add 2 div /ycenter exch def - userdict /gotpagebbox true put -} def - -/pagesetup {/page exch def} bind def - -/bitmap { - /scanlines exch def - /scanlength exch def - /flip exch def - /v8format exch def - - /bytelength scanlength 8 idiv def - /picstr bytelength string def - /lpicstr bytelength string def - /bytelength bytelength 1 sub def - - gsave - -% First the overall scaling. - - height scanlines div width scanlength div min - 72 screenres div min - dup scale - -% Followed by the one for the unit square. - - scanlength neg 2 div scanlines neg 2 div translate - scanlength scanlines scale - v8format {getv8bitmap} {getbitmap} ifelse - grestore -} bind def - -/getbitmap { - scanlength scanlines flip [scanlength 0 0 scanlines neg 0 scanlines] { - 0 { - currentfile token pop dup - 0 eq {pop pop exit} if - /charcount exch def - picstr 1 index charcount getinterval - /repl exch def - currentfile repl readhexstring pop pop - charcount add - currentfile token pop { - picstr 1 index repl putinterval - charcount add - } repeat - } loop - picstr - } imagemask -} bind def - -/getv8bitmap { - scanlength scanlines flip not [scanlength 0 0 scanlines neg 0 scanlines] { - 0 { - currentfile token pop dup - 0 eq {pop pop exit} if - /charcount exch def - picstr 1 index charcount getinterval - /repl exch def - currentfile repl readhexstring pop pop - charcount add - currentfile token pop { - picstr 1 index repl putinterval - charcount add - } repeat - } loop - 0 0 picstr { - exch lpicstr exch get xor - lpicstr exch 2 index exch put - 1 add dup - } forall - pop pop lpicstr - } imagemask -} bind def - -/done {/lastpage where {pop lastpage} if} def diff -r 30ca6bbf5b09 -r de6c57673fcc usr/src/cmd/lp/filter/postscript/postscript/postmd.ps --- a/usr/src/cmd/lp/filter/postscript/postscript/postmd.ps Sun Apr 03 16:13:38 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -%ident "@(#)lp:filter/postscript/postscript/postmd.ps 1.1" -% -% CDDL HEADER START -% -% The contents of this file are subject to the terms of the -% Common Development and Distribution License, Version 1.0 only -% (the "License"). You may not use this file except in compliance -% with the License. -% -% You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -% or http://www.opensolaris.org/os/licensing. -% See the License for the specific language governing permissions -% and limitations under the License. -% -% When distributing Covered Code, include this CDDL HEADER in each -% file and include the License file at usr/src/OPENSOLARIS.LICENSE. -% If applicable, add the following below this CDDL HEADER, with the -% fields enclosed by brackets "[]" replaced with your own identifying -% information: Portions Copyright [yyyy] [name of copyright owner] -% -% CDDL HEADER END -% -% -% Version 3.15 prologue for matrix display files. -% - -/#copies 1 store -/aspectratio 1 def -/font /Helvetica def -/formsperpage 1 def -/landscape false def -/magnification 1 def -/margin 10 def -/orientation 0 def -/size 9 def -/statspace 1.6 def -/ticklength .06 def -/tickspacing 10 def -/xoffset 0 def -/yoffset 0 def - -/useclippath true def -/pagebbox [0 0 612 792] def - -/inch {72 mul} bind def -/min {2 copy gt {exch} if pop} bind def - -/setup { - counttomark 2 idiv {def} repeat pop - - landscape {/orientation 90 orientation add def} if - - pagedimensions - height width lt { - /statspace statspace height width div mul def - /size size height width div mul def - /ticklength ticklength height width div mul def - } if - /height height margin sub statspace inch sub ticklength inch sub size 6 mul sub def - /width width margin sub ticklength inch sub def - xcenter ycenter translate - orientation neg rotate - xoffset inch yoffset inch translate - 0 height 2 div height width min 2 div sub translate - 0 statspace inch 2 div translate - magnification dup aspectratio mul scale - - 0 setlinewidth -} def - -/pagedimensions { - useclippath { - /pagebbox [clippath pathbbox newpath] def - } if - pagebbox aload pop - 4 -1 roll exch 4 1 roll 4 copy - landscape {4 2 roll} if - sub /width exch def - sub /height exch def - add 2 div /xcenter exch def - add 2 div /ycenter exch def - userdict /gotpagebbox true put -} def - -/pagesetup {/page exch def} bind def - -/bitmap { - /scanlines exch def - /scanlength exch def - - /picstr scanlength string def - - gsave - height scanlines div width scanlength div min - /scaling exch def - scaling scaling scale - - scanlength neg 2 div scanlines neg 2 div translate - scanlength scanlines scale - getbitmap - grestore -} bind def - -/getbitmap { - scanlength scanlines 8 [scanlength 0 0 scanlines neg 0 scanlines] { - 0 { - currentfile token pop dup - 0 eq {pop pop exit} if - /charcount exch def - picstr 1 index charcount getinterval - /repl exch def - currentfile repl readhexstring pop pop - charcount add - currentfile token pop { - picstr 1 index repl putinterval - charcount add - } repeat - } loop - picstr - } image -} bind def - -/labelmatrix { - /matrixlimits exch def - /matrixname exch def - - gsave - scaling scaling scale - font findfont size scaling div scalefont setfont - scanlength neg 2 div scanlines 2 div translate - - 0 scanlines size 1.5 mul scaling div add neg moveto - matrixname show - - scanlength scanlines size 1.5 mul scaling div add neg moveto - matrixlimits stringwidth pop neg 0 rmoveto - matrixlimits show - - newpath - 0 0 moveto - scanlength 0 rlineto - 0 scanlines neg rlineto - scanlength neg 0 rlineto - closepath stroke - - scanlength tickspacing idiv 1 add tickspacing 0 ticks - scanlines tickspacing idiv 1 add 0 tickspacing neg ticks - grestore -} bind def - -/ticks { - /dy exch def - /dx exch def - - /tl ticklength inch scaling div def - newpath - 0 0 moveto - { - gsave dx 0 eq {tl neg 0} {0 tl} ifelse rlineto stroke grestore - dx dy rmoveto - } repeat -} bind def - -/legend { - /regions exch def - /total exch def - - gsave - width height min 2 div neg dup size 2 mul sub translate - 0 statspace inch neg translate - - gsave - regions { - gsave - total div statspace inch size 2 mul sub mul size 2 mul add - width height min regions div exch scale - 1 1 8 [1 0 0 1 0 0] 5 -1 roll image - grestore - width height min regions div 0 translate - } repeat - grestore - - width height min size 1.5 mul neg translate - font findfont size scalefont setfont - dup dup add 1 add width height min exch div /interval exch def - { - interval neg 0 translate - interval 2 div neg 0 translate - dup stringwidth pop 2 div neg 0 moveto show - interval 2 div neg 0 translate - } repeat - grestore -} bind def - -/done {/lastpage where {pop lastpage} if} def diff -r 30ca6bbf5b09 -r de6c57673fcc usr/src/cmd/lp/filter/postscript/postscript/postplot.ps --- a/usr/src/cmd/lp/filter/postscript/postscript/postplot.ps Sun Apr 03 16:13:38 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -%ident "@(#)lp:filter/postscript/postscript/postplot.ps 1.2" -% -% CDDL HEADER START -% -% The contents of this file are subject to the terms of the -% Common Development and Distribution License, Version 1.0 only -% (the "License"). You may not use this file except in compliance -% with the License. -% -% You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -% or http://www.opensolaris.org/os/licensing. -% See the License for the specific language governing permissions -% and limitations under the License. -% -% When distributing Covered Code, include this CDDL HEADER in each -% file and include the License file at usr/src/OPENSOLARIS.LICENSE. -% If applicable, add the following below this CDDL HEADER, with the -% fields enclosed by brackets "[]" replaced with your own identifying -% information: Portions Copyright [yyyy] [name of copyright owner] -% -% CDDL HEADER END -% -% -% Version 3.15 prologue for Unix plot files - System V version. -% - -/#copies 1 store -/aspectratio 1 def -/font /Courier def -/formsperpage 1 def -/landscape false def -/linewidth 0 def -/magnification 1 def -/margin 10 def -/orientation 0 def -/screenheight 4096 def -/screenwidth 4096 def -/size 10 def -/xoffset 0 def -/yoffset 0 def -/xtextshift 0 def -/ytextshift 0 def - -/useclippath true def -/pagebbox [0 0 612 792] def - -/inch {72 mul} bind def -/min {2 copy gt {exch} if pop} bind def - -/setup { - counttomark 2 idiv {def} repeat pop - - landscape {/orientation 90 orientation add def} if - - pagedimensions - /scaling - height margin sub screenheight div - width margin sub screenwidth div - min def - xcenter ycenter translate - orientation neg rotate - xoffset inch yoffset inch translate - magnification dup aspectratio mul scale - - /height height margin sub def - /width width margin sub def - font findfont size scaling div scalefont setfont - 1 setlinecap - newpath -} def - -/pagedimensions { - useclippath userdict /gotpagebbox known not and { - /pagebbox [clippath pathbbox newpath] def - } if - pagebbox aload pop - 4 -1 roll exch 4 1 roll 4 copy - landscape {4 2 roll} if - sub /width exch def - sub /height exch def - add 2 div /xcenter exch def - add 2 div /ycenter exch def - userdict /gotpagebbox true put -} def - -/pagesetup {/page exch def} bind def - -/space { - /screenheight exch def - /screenwidth exch def -} bind def - -/setupspace { - /scaling - height margin sub screenheight div - width margin sub screenwidth div - min def - scaling scaling scale - screenwidth neg 2 div screenheight neg 2 div translate - linewidth scaling div setlinewidth - font findfont size scaling div scalefont setfont - /spotsize linewidth 0 eq {.2} {linewidth 2 div} ifelse scaling div def -} bind def - -/f {dup {scaling div} forall counttomark -1 roll astore 0 setdash} bind def -/l {moveto lineto stroke} bind def -/m {newpath moveto} bind def -/n /lineto load def -/s /stroke load def -/p {spotsize 0 360 arc fill} bind def -/c {0 360 arc stroke} bind def - -/a { - /dy2 exch def - /dx2 exch def - /dy1 exch def - /dx1 exch def - dx1 dx1 mul dy1 dy1 mul add sqrt - dy1 dx1 atan - dy2 dx2 atan - arc stroke -} bind def - -/t { - moveto - size scaling div dup xtextshift mul exch ytextshift mul rmoveto - show -} bind def - -/done {/lastpage where {pop lastpage} if} def diff -r 30ca6bbf5b09 -r de6c57673fcc usr/src/cmd/lp/filter/postscript/postscript/posttek.ps --- a/usr/src/cmd/lp/filter/postscript/postscript/posttek.ps Sun Apr 03 16:13:38 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -%ident "@(#)lp:filter/postscript/postscript/posttek.ps 1.1" -% -% CDDL HEADER START -% -% The contents of this file are subject to the terms of the -% Common Development and Distribution License, Version 1.0 only -% (the "License"). You may not use this file except in compliance -% with the License. -% -% You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -% or http://www.opensolaris.org/os/licensing. -% See the License for the specific language governing permissions -% and limitations under the License. -% -% When distributing Covered Code, include this CDDL HEADER in each -% file and include the License file at usr/src/OPENSOLARIS.LICENSE. -% If applicable, add the following below this CDDL HEADER, with the -% fields enclosed by brackets "[]" replaced with your own identifying -% information: Portions Copyright [yyyy] [name of copyright owner] -% -% CDDL HEADER END -% -% -% Version 3.15 prologue for tektronix 4014 files. -% - -/#copies 1 store -/aspectratio 1 def -/fixlinewidth true def -/font /Courier def -/formsperpage 1 def -/landscape true def -/linewidth 0 def -/magnification 1 def -/margin 10 def -/orientation 0 def -/screenheight 3120 def -/screenwidth 4150 def -/spotsize 1 def -/xoffset 0 def -/yoffset 0 def - -/useclippath true def -/pagebbox [0 0 612 792] def - -/inch {72 mul} bind def -/min {2 copy gt {exch} if pop} bind def - -/setup { - counttomark 2 idiv {def} repeat pop - - landscape {/orientation 90 orientation add def} if - - pagedimensions - /scaling - height margin sub screenheight div - width margin sub screenwidth div - min def - xcenter ycenter translate - orientation neg rotate - xoffset inch yoffset inch translate - magnification dup aspectratio mul scale - scaling scaling scale - screenwidth 2 div neg screenheight 2 div neg translate - - tietodevicespace - linewidth scaling div setlinewidth - 1 setlinecap - newpath -} def - -/pagedimensions { - useclippath { - /pagebbox [clippath pathbbox newpath] def - } if - pagebbox aload pop - 4 -1 roll exch 4 1 roll 4 copy - landscape {4 2 roll} if - sub /width exch def - sub /height exch def - add 2 div /xcenter exch def - add 2 div /ycenter exch def - userdict /gotpagebbox true put -} def - -/pagesetup {/page exch def} bind def - -/tietodevicespace { - fixlinewidth linewidth 0 gt and linewidth 1 lt and { - /moveto { - 2 copy /Y exch def /X exch def - transform round exch round exch itransform - moveto - } bind def - /lineto { - 2 copy /Y exch def /X exch def - transform round exch round exch itransform - lineto - } bind def - /rlineto {Y add exch X add exch lineto} bind def - /v V 0 get bind def - } if -} def - -/V [{moveto counttomark 2 idiv {rlineto} repeat stroke}] def -/v V 0 get bind def -/p {newpath spotsize 0 360 arc fill} bind def - -/l {{scaling div} forall counttomark array astore 0 setdash} bind def -/w {linewidth 0 eq {.3} {linewidth} ifelse mul linewidth add scaling div setlinewidth} bind def -/i {3 mul 4 sub -100 div mul .5 add /spotsize exch def} bind def - -/f {/charwidth exch def font findfont charwidth .6 div scalefont setfont} bind def - -/t { - 3 1 roll moveto - currentpoint { - pop pop - exch charwidth add exch - moveto currentpoint - } 4 -1 roll kshow - pop pop -} bind def - -/done {/lastpage where {pop lastpage} if} def