|
This utility program prints pages of matricies covering all possible combinations of parameters. The arrays in theGroups arrays have three elements. The first element of the array is an array which enumerates (and names) each of the pages. (If that first element is /nil, only one page will print.) The second and third elements control the names of the columns and rows of the matrix. |
%!PS PaperTypeMatrix.ps by Gary Garchar 11/20/95, 6/10/96,
%<< /HWResolution [180 180] >> setpagedevice
%(Common.ps) run
% ARRAYS
/theGroups [
%[ /PageSize /Orientation /PaperType ]
%[ /PaperType /Orientation /PageSize ]
%[ /Platform /Printer /Application ]
%[ /Printer /Orientation /PaperType ]
[ /nil /Measurements /PaperType ]
%[ /nil /Platform /TestArea ]
] def
/Application [
(Acrobat)
(Canvas)
(Freehand)
(Illustrator)
(MacDraw Pro)
(PageMaker)
(Painter)
(Photoshop)
(PixelPaint Pro 3)
(QuarkXpress)
] def
/Orientation [
(Portrait)
(Landscape 1)
(Landscape 2)
] def
/Setup [
(Printer)
(Interface)
(Paper Size)
(Application)
] def
/TestArea [
(Documentation)
(Installation)
(User Interface)
(App Compatibility)
(Print Quality)
(Performance)
] def
/Orientation [
(Portrait)
(Landscape)
] def
/PaperType [
(US Letter)
(Letter.Transverse)
(Legal)
(A3)
(A4)
(A4.Transverse)
(Statement)
(Executive)
(US B (Tabloid))
(A3+/B+)
(No.10 Envelope)
(DL Envelope)
(C5 Envelope)
] def
/xPaperType [
(Letter 8 1/2 x 11 in)
(Legal 8 1/2 x 14 in)
(A3 297 x 420 mm)
(A4 210 x 297 mm)
(Statement 5 1/2 x 8 1/2)
(Executive 7 1/2 x 10 in)
(US B)
(A3+/B+)
(No.10 Envelope)
(DL Envelope)
(C5 Envelope)
] def
/PageSize [
(8x8)
(7x8)
(8x7)
] def
/Platform [
(Mac 68k)
(PowerMac)
(Win 3.11)
(Win NT)
(Win 95)
] def
/Printer [
%(Stylus Color)
(Stylus Pro)
(Stylus Pro XL)
(Stylus Pro XL+)
] def
/nil [
%(PowerRIP 4.0 6/14)
()
] def
/Measurements [
(Points)
(Inches)
(Millimeters)
(Ratio)
(Percent)
] def
/Main {
PageSetup
InitValues
theGroups {
aload pop % STACK: NAME, NAME, NAME
3 -1 roll cvx exec {
/title0 exch def
2 copy MatrixPage
title0 ShowTitle0
showpage
} forall
} forall
pop pop
} def
/MatrixPage { % STACK: NAME, NAME
AreaSetup
2 copy SetValues
=string cvs ShowTitle2 =string cvs ShowTitle1
itemCount1 itemCount2 DrawGrid
gsave % LABEL AXIS
xSpot ySpot translate
itemArray2 yUnit ShowVert
90 rotate
itemArray1 xUnit ShowHorz
grestore
%HeadingRect
} def
/SetValues { % STACK: NAME, NAME
/itemArray2 exch cvx exec def /itemArray1 exch cvx exec def
/itemCount1 itemArray1 length def
/itemCount2 itemArray2 length def
/pointSize1 18 0.4 itemCount1 mul sub dup 9 lt { pop 9 } if def
/pointSize2 18 0.4 itemCount2 mul sub dup 9 lt { pop 9 } if def
gsave
/Helvetica findfont pointSize1 scalefont setfont
/maxWidth1 itemArray1 StringArrayWidth gap 4 mul add def
/Helvetica findfont pointSize2 scalefont setfont
/maxWidth2 itemArray2 StringArrayWidth gap 4 mul add def
grestore
/xSpot maxWidth2 def
/ySpot areaHeight maxWidth1 sub def
/gridWidth areaWidth xSpot sub def
/gridHeight ySpot def
/xUnit { gridWidth itemCount1 div } def
/yUnit { gridHeight itemCount2 div } def
} def
% SUBROUTINES
/DrawGrid { % STACK: INT, INT
/rowCount exch def
/columnCount exch def
/x xSpot def
/y 0 def
gsave
0 setlinewidth
rowCount {
xSpot y gridWidth yUnit rectstroke
/y y yUnit add def
} repeat
columnCount {
x 0 xUnit gridHeight rectstroke
/x x xUnit add def
} repeat
grestore
} def
/HeadingRect {
gsave
2 setlinewidth .9 setgray
0 ySpot gap add
xSpot gap sub areaHeight ySpot sub gap sub
rectstroke
grestore
} def
/ShowHorz { % STACK: ARRAY, INT
/theUnit exch def
/theArray exch def
0 0 moveto
gsave
/Times-Roman findfont pointSize1 scalefont setfont
gap theUnit pointSize1 add 2 div neg rmoveto
theArray {
gsave show grestore
0 theUnit neg rmoveto
} forall
grestore
} def
/ShowPageCode { % STACK: STRING, STRING
/Helvetica findfont 14 scalefont setfont
exch (-) exch
gsave
areaWidth gap add 14 gap add neg moveto % BOTTOM RIGHT
3 {
{
dup 0 1 getinterval show % SHOW FIRST CHARACTER
( ) search { % ANOTHER WORD?
pop pop
}{
pop exit
} ifelse
} loop
} repeat
grestore
} def
/ShowPageNumber { % STACK: STRING
/Helvetica findfont 14 scalefont setfont
gsave
areaWidth gap add 14 gap add neg moveto % BOTTOM RIGHT
show
grestore
} def
/ShowTitle0 { % STACK: STRING
gsave
/Helvetica findfont 14 scalefont setfont
areaWidth 14 gap add neg moveto % BOTTOM RIGHT
RightShow
grestore
} def
/xShowTitle0 { % STACK: STRING
gsave
5 areaHeight 18 sub moveto
/Helvetica-Bold findfont 18 scalefont setfont
{
( ) search {
gsave show grestore pop
0 -18 rmoveto
}{ show exit } ifelse
} loop
grestore
} def
/ShowTitle { % STACK: STRING
gsave
/Helvetica findfont 18 scalefont setfont
0 areaHeight moveto
RightShow
grestore
} def
/ShowTitle1 { % STACK: STRING
gsave
/Helvetica-Bold findfont 18 scalefont setfont
xSpot areaHeight moveto
gridWidth CenterShow
grestore
} def
/ShowTitle2 { % STACK: STRING
gsave
/Helvetica-Bold findfont 18 scalefont setfont
0 0 moveto
90 rotate
gridHeight CenterShow
grestore
} def
/ShowVert { % STACK: ARRAY, INT
/theUnit exch def
/theArray exch def
0 0 moveto
gsave
/Times-Roman findfont pointSize2 scalefont setfont
gap neg theUnit pointSize2 add 2 div neg rmoveto
theArray {
gsave RightShow grestore
0 theUnit neg rmoveto
} forall
grestore
} def
% PRELIMINARY ROUTINES
/PageSetup {
/leftMargin 50 def
/rightMargin 50 def
/topMargin 80 def
/botMargin 80 def
612 792 /pageHeight exch def /pageWidth exch def
} def
/LandScape {
90 rotate
pageHeight pageWidth /pageHeight exch def /pageWidth exch def
0 pageHeight neg translate % ORIGIN IS BOT LEFT OF PAGE
} def
/AreaSetup { % TRANSLATION
/areaWidth pageWidth leftMargin sub rightMargin sub def
/areaHeight pageHeight botMargin sub topMargin sub def
leftMargin botMargin translate % ORIGIN IS BOT LEFT OF AREA
} def
/InitValues {
/gap 7 def
} def
% UTILITY ROUTINES
/HorzLine { dup 0 exch MoveTo 36 exch StrokeTo } def
/MoveTo { yUnits exch xUnits exch moveto } def
/StrokeTo { yUnits exch xUnits exch lineto stroke } def
/HorzStroke { exch 3 -1 roll dup 3 1 roll MoveTo StrokeTo } def
/VertStroke { 2 index exch 4 2 roll MoveTo StrokeTo } def
/CenterShow { % STACK: STRING, INT
exch dup stringwidth pop 3 -1 roll exch sub 2 div 0 rmoveto show
} def
/CenterX { % STACK: STRING, INT -> STRING, INT
1 index stringwidth pop sub 2 div
} def
/RightShow { dup stringwidth pop neg 0 rmoveto show } def
/StringArrayWidth { % STACK: ARRAY -> INT
/maxWidth 0 def
{
stringwidth pop dup
maxWidth gt { /maxWidth exch def }{ pop } ifelse
} forall
maxWidth
} def
/Debug { % REDEFINE PROCS TO DISPLAY NAME WHEN CALLED
[ % STACK ALL ARRAYTYPES OF CURRENT DICTIONARY INTO AN ARRAY
currentdict {
type dup /arraytype ne exch /packedarraytype ne and { pop } if
} forall
] { % REDEFINE ALL OF THEM
[ 1 index dup load exch { == } /exec load dup ] cvx bind def
} forall
} def
/rectstroke { %STACK: x, y, width, height
4 dict begin
/height exch def
/width exch def
/y exch def
/x exch def
gsave
newpath
x y moveto
width 0 rlineto
0 height rlineto
width neg 0 rlineto
closepath
stroke
grestore
end
} def
%Debug ErrHand
Main % EXECUTE!
%%EOF