%!PS % New combined paper translated from Neely then unsplit % =================================== % by Don Lancaster GG #122 HANGCAN1.PSL % Creation date August 2013 /ggnum 122 store % Copyright c 2010,2012 by Don Lancaster & Synergetics, Box 809, Thatcher, AZ, 85552 % (928) 428-4073 Email: don@tinaja.com Website: http://www.tinaja.com % Consulting services available http://www.tinaja.com/info01.html % Linking welcome. Reposting expressly forbidden. % All commercial rights and all electronic media rights ~fully~ reserved. % Linking usually welcome. Reposting expressly forbidden. Version 2.1 % IMPORTANT NOTE: Don Lancaster's file gonzo.ps is required for this program. % After obvious location mods, uncomment ONE of the following two lines: % (C:\\gonzo\\gonzo.ps) run % use internal gonzo modified for root %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% FILE FREE GONZO NEEDED BY ACROBAT X AND HIGHER %%%%%%%%%%%%%%%%% % GONZO20A Guru Gonzo PostScript power tools (Interim release) % Includes gonzo justification and layout utilities. % Copyright c 1990,1996 by Don Lancaster and Synergetics, Box 809, % Thatcher Arizona, 5552 (520) 428-4073 don@tinaja.com support % via http://www.tinaja.com All commercial rights and all electronic % media rights **FULLY** reserved. Reposting is expressly forbidden. % this is a combined pagemaking and illustration package that is % extremely device independent, powerful, and flexible. But not wysiwyg %%%%%%%%%%%%%%%%%%%%%%%%%% % name of textfile: powertool.util % .... % last revision: September 1996 added cr/lf substitution /ps.util.1 {gutil} def % substitute old name /gutility {gutil} def % substitute old name /guru { gonzo begin ps.util.1 begin printerror nuisance begin} def % jumpstart 200 dict /gutil exch def gutil begin % A series of Don Lancaster Gonzo PostScript utilities that include: % (1) stepnrepeat - addressible step and repeat routines % (2) curvetrace - a powerful curve tracing routine % (3) rubbergrid - dropout-free gray layout/graphing grids % (4) line drawing - line drawing utilities % (5) electronics - electronic schematic icons for rubbergrid % (6) arcjustify - improved circletext routine with kerning % (7) fone elim - eliminates any need for end user fonts % (8) nuisances - single command replacements for complex stuff % (9) errortrap - printing error trapping routine % (10) gonzojust - gonzo justify package % ///// % (1) step and repeat % % Horizontal and vertical are defined AFTER selecting portrait or % landscape. Parameters (in points or true/false) are as follows... % % #horizrpts - times proc repeats in horizontal direction % #vertrpts - times proc repeats in vertical direction % hspacing - horizontal proc repeat spacing % vspacing - vertical proc repeat spacing % hstart - horizontal offset of first proc % vstart - vertical offset of first proc % ticklen - length of cropping ticks when and if used % useticks? - show the ticks true/false boolean % landscape - landscape orientation true/false boolean /stepnrptparams 40 dict def stepnrptparams begin /admitonetick [5 9 150 60 25 25 10 true true] def % 45 tickets /babybumper [2 10 270 72 40 30 20 true false] def % 20 stickers /badgeaminit [2 3 220 220 90 60 250 false false] def % 6 badges /bigbumpstick [1 3 792 205 0 0 40 true true] def % 3 bumperstickers /buscard [3 4 256 143 12 20 20 true true] def % 12 buscards /busenvelope [1 1 685 305 0 150 20 true true] def % 1 envelope /eightlabel [2 4 306 198 0 0 50 true false] def % 1/8 page /fulllandpage [1 1 0 0 20 20 50 false true] def % entire landscape page /fullportpage [1 1 0 0 20 20 50 false false] def % entire portrait page /lilbumpstick [1 5 610 150 0 20 60 true false] def % 5 blumperstickers /quadsplit [2 2 396 306 0 0 50 true true] def % 1/4 page /readerserv [12 25 25 -15 120 450 0 false false] def % 300 RS numabers /shiplabel [1 4 290 180 160 65 40 true false] def % 4 custom labels /sixlabel [2 3 306 264 0 0 50 true false] def % 1/6 page /stdplabel [1 11 254 74 185 5 20 true false] def % 11 stock dp labels /tenlabel [2 5 305 144 0 45 50 true false] def % 1/10 page /videospline [1 13 424 60.3 80 34 0 false false] def % 13 VHS splines /3.5disklabel [2 3 216 226 100 60 20 false false] def % 6 disk labels 3.5 /5.25disklabel [1 7 316 110 275 35 0 false false] def % 7 disk labels 5.25 end % /setrepeatparams is a working tool that extracts the selected repeat % values from an entry in stepnrptparams. /setrepeatparams {cvn stepnrptparams exch get aload pop /landscape1 exch def /ticktrue exch def /ticklen exch def /vertstart exch def /horstart exch def /incvert exch def /inchoriz exch def /numvert exch def /numhoriz exch def} def % /onetick optionally draws a single tick or crop mark, while /drawticks % puts one at each corner of each form /onetick { 0 ticklen 2 div rmoveto 0 ticklen neg rlineto ticklen 2 div neg dup neg rmoveto ticklen 0 rlineto 0 setlinewidth stroke} def /drawticks {gsave ticktrue {0 0 moveto onetick inchoriz 0 moveto onetick 0 incvert moveto onetick inchoriz incvert moveto onetick} if grestore}def % default variables used by stepnrpt /srexitproc {} def % default short exit - don't do it. /numpages 1 def % default number of sheets to print /startnum 0 def % initial ticket number /runnum startnum def % running pointer advances one per repeat /repeatproc {} def % artwork to get repeated default /customdata false def % autopaginate custom data? % /srfile gets used for custom entries. Each entry can be a string or a % proc, but ONLY ONE ENTRY is allowed per final repeat. /srfile [(You) (forgot) (to) (define) (srfile!)] def % default srfile % /calcpages is an optional routine that decides how many pages are % needed ONLY when you are using a custom srfile. This allows early % exits when or if you run out of data. /calcpages {dup cvn stepnrptparams exch get dup 0 get exch 1 get mul cvi srfile length exch div ceiling cvi /numpages exch def} def % This is the main stepandrepeat tool... /stepandrepeat { save /srsnap exch def mark exch /quickexit false def customdata {calcpages} if setrepeatparams numpages {gsave landscape1 {-90 rotate -792 0 translate} if horstart vertstart translate gsave numhoriz {gsave numvert {drawticks save /rptsave1 exch def repeatproc rptsave1 restore /runnum runnum 1 add def 0 incvert translate srexitproc} repeat quickexit {exit} if grestore inchoriz 0 translate} repeat quickexit {exit} if grestore showpage grestore} repeat quickexit {showpage} if cleartomark srsnap restore} def % To force an early exit when you run out of names or reach a given % ticket number, test suitably. Then conditionally make /quickexit % true and exit repeatproc. % Note that an ending showpage is NOT required and should NOT be used. % ////// % (2) curvetrace % . . . . . % curvetrace - creates a smooth curved path from a data point list. % enter with currentpoint set and absolute array. % 0 0 as initial data appends path; any other values % creates new path /curvetrace {/curvelist exch def tension 0 eq {/tension .000001 def} if curvelist length 3 div 1 sub cvi /#triads exch def /ptr 0 def firstpoint morepoint} def /tension 2.83 def % default value for best fit /showtick false def % don't show points /ticklen 15 def % length of ticks /tickhead ticklen 4 div def /prvx { curvelist ptr 3 sub get } def /curx { curvelist ptr get } def /prvy { curvelist ptr 2 sub get } def /cury { curvelist ptr 1 add get } def /prva { curvelist ptr 1 sub get } def /cura { curvelist ptr 2 add get 180 sub} def /showtic1 { showtick true eq {gsave currentpoint newpath translate cura 180 add rotate ticklen neg 2 div 0 moveto ticklen 0 rlineto tickhead neg dup rlineto tickhead dup rlineto tickhead dup neg exch rlineto 0 setlinewidth stroke 0 ticklen neg 2 div moveto 0 ticklen rlineto stroke grestore} if }def /firstpoint { curx cury 2 copy abs exch abs add 0 eq {pop pop currentpoint curvelist exch 1 exch put curvelist exch 0 exch put}{moveto} ifelse showtic1 /ptr ptr 3 add def}def /morepoint {#triads { curx prvx sub dup mul cury prvy sub dup mul add sqrt tension div /zdist exch def prva cos zdist mul prvx add prva sin zdist mul prvy add cura cos zdist mul curx add cura sin zdist mul cury add curx cury curveto showtic1 /ptr ptr 3 add def} repeat} def /showtick false def % ////////////////////////////////// % (3) Finegray Rubbergrid % . . . . . . % Creates fine gray grids without dropouts or rattiness. % The code shown is device specific for 300 dpi printers. % To create a grid, use -hpos- -vpos- -gridsize- setgrid % Until restored, all further images will be "locked" to % the grid and will expand and contract with it. Note that % optimum linewidths and font sizes will usually be much % less than 1.0 after locking. % To show a grid, use -#hlines- -#vlines- showgrid. % The seegrid command displays the grid when true. % The fat5 command emphasizes every fifth line when true. % the fatter10 command emphasizes every tenth line when true. % Here are the graphing grays. For most users most of the time, % select ggray4 or ggray5 as your default ggray. /ggray1 {/ggray{0 setgray} def}def /ggray2 {/ggray {150 0 {eq {1}{0} ifelse} setscreen 0.500 setgray} def} def /ggray3 {/ggray {100 0 {eq {1}{0} ifelse} setscreen 0.667 setgray} def} def /ggray4 {/ggray { 75 0 {eq {1}{0} ifelse} setscreen 0.750 setgray} def} def /ggray5 {/ggray { 60 0 {eq {1}{0} ifelse} setscreen 0.800 setgray} def} def /ggray6 {/ggray { 50 0 {eq {1}{0} ifelse} setscreen 0.833 setgray} def} def /ggray10 {/ggray { 30 0 {eq {1}{0} ifelse} setscreen 0.900 setgray} def} def /ggray15 {/ggray { 20 0 {eq {1}{0} ifelse} setscreen 0.933 setgray} def} def /ggray20 {/ggray { 15 0 {eq {1}{0} ifelse} setscreen 0.950 setgray} def} def /ggray30 {/ggray { 10 0 {eq {1}{0} ifelse} setscreen 0.966 setgray} def} def % pick a default working ggray /ggray {60 0 {eq {1}{0} ifelse} setscreen 0.800 setgray} def % keep grids unlocked except for Golly Gee Mr. Science!! uses requiring not % less than two exclamation points... /lockggrid false def % Don't unless really needed % gridlockcheck checks to see if an exact pixel lock is wanted for single % dot crossings. See note above. 51.7 = QMS PS820. Your machine may also % need "exception tuning" if it does not give you perfect one dot crossings. /gridlockcheck {lockggrid {gsave ggray currentscreen grestore pop pop /ggraynum exch def ggraynum 150 eq {3 1 roll transform 2 div round 2 mul exch 2 div round 2 mul version (51.7) eq {0.5 add } if exch itransform 3 -1 roll 0 exch dtransform 2 div cvi 2 mul idtransform exch pop} if ggraynum 100 eq {3 1 roll transform 3 div round 3 mul exch 3 div round 3 mul version (51.7) eq {0.5 add } if exch itransform 3 -1 roll 0 exch dtransform 3 div cvi 3 mul idtransform exch pop} if ggraynum 75 eq {3 1 roll transform 4 div round 4 mul exch 4 div round 4 mul version (51.7) eq {0.5 add } if exch itransform 3 -1 roll 0 exch dtransform 4 div cvi 4 mul idtransform exch pop} if ggraynum 60 eq {3 1 roll transform 5 div round 5 mul exch 5 div round 5 mul version (51.7) eq {0.5 add } if exch itransform 3 -1 roll 0 exch dtransform 5 div cvi 5 mul idtransform exch pop} if ggraynum 50 eq {3 1 roll transform 6 div round 6 mul exch 6 div round 6 mul version (51.7) eq {0.5 add } if exch itransform 3 -1 roll 0 exch dtransform 6 div cvi 6 mul idtransform exch pop} if ggraynum 30 eq {3 1 roll transform 10 div round 10 mul exch 10 div round 10 mul version (51.7) eq {0.5 add } if exch itransform 3 -1 roll 0 exch dtransform 10 div cvi 10 mul idtransform exch pop} if ggraynum 20 eq {3 1 roll transform 15 div round 15 mul exch 15 div round 15 mul version (51.7) eq {0.5 add } if exch itransform 3 -1 roll 0 exch dtransform 15 div cvi 15 mul idtransform exch pop} if ggraynum 15 eq {3 1 roll transform 20 div round 20 mul exch 20 div round 20 mul version (51.7) eq {0.5 add } if exch itransform 3 -1 roll 0 exch dtransform 20 div cvi 20 mul idtransform exch pop} if }if} def /setgrid { gsave gridlockcheck /blocksize exch def translate blocksize dup scale setfontssmaller} def /thingridlines {0} def % can alter if you must magnify; but best 0 /showgrid {gsave ggray /vblocks exch def /hblocks exch def thingridlines setlinewidth [{0 0 moveto 0 vblocks rlineto stroke} 1 hblocks 1 add] xrpt [{0 0 moveto hblocks 0 rlineto stroke} 1 vblocks 1 add] yrpt fatterborder { gsave newpath 0 0.96 blocksize div dtransform round idtransform setlinewidth pop 2 setlinecap 0 0 moveto hblocks 0 rlineto 0 vblocks rlineto hblocks neg 0 rlineto closepath stroke grestore} if fat5 { gsave newpath 0 0.48 blocksize div dtransform round idtransform setlinewidth pop mark {5 0 moveto 0 vblocks rlineto stroke} 5 hblocks 5 div cvi] xrpt mark {0 5 moveto hblocks 0 rlineto stroke} 5 vblocks 5 div cvi] yrpt grestore} if fatter10 { gsave newpath 0 0.96 blocksize div dtransform round idtransform setlinewidth pop mark {10 0 moveto 0 vblocks rlineto stroke} 10 hblocks 10 div cvi] xrpt mark {0 10 moveto hblocks 0 rlineto stroke} 10 vblocks 10 div cvi] yrpt grestore} if grestore} def % Here are our rubbergrid controls... /lockrubbergrid false def % Don't unless really needed /fat5 true def % 3 pixels wide every fifth line? /fatter10 true def % 5 pixels wide every tenth line? /fatterborder true def % 5 pixel gray outline border? % rubbergrid utilities - drawing aides for the rubbergrid % line drawing stuff /line1 {.06 dup setlinewidth 5 mul /erase exch def} def /line2 {.12 dup setlinewidth 5 mul /erase exch def} def /line3 {.18 dup setlinewidth 5 mul /erase exch def} def % deferred font setting TEMPORARY - will be moved to gonzo /setfontssmaller { /yinc 1 def /pmrun 0 def /charstretch 0.033 def /spacestretch 0.05 def /ybot -9999 def /lastlinestretch lastlinestretch 0.1 mul def /font1 /Helvetica [0.7 0 0 0.8 0 0] gonzofont /font2 /Helvetica-Bold [0.7 0 0 0.8 0 0] gonzofont /font3 /Symbol [0.7 0 0 0.8 0 0] gonzofont /font4 /Helvetica [0.5 0 0 0.4 0 0] gonzofont /font5 /Helvetica-Bold [1.6 0 0 1 0 0] gonzofont } def % An improved graygrid routine that works BOTH at 300 and 600 DPI... /ggray {60 0 {sub abs 0.21 lt {1}{0} ifelse} setscreen gsave 0 60 0 {pop pop 1 add 1} setscreen grestore dup 25 eq {pop 0.8}{100 eq {0.72}{0.765} ifelse} ifelse setgray} def % ////////////////////////////////// % (4) Line drawing utilities % . . . . . . /mt {moveto} def /rm {rmoveto} def /rl {rlineto} def % these draw individual lines /x {rlineto currentpoint stroke moveto} def /r {0 x} def /r+ {dup x} def /r- {dup neg x} def /l {neg 0 x} def /l+ {neg dup neg x} def /l- {neg dup x} def /u {0 exch x} def /d {0 exch neg x} def % these create a path /pl {neg 0 rl} def /pl+ {neg dup neg rl} def /pl- {neg dup rl} def /pr { 0 rl} def /pr+ {dup rl} def /pr- {dup neg rl} def /pu {0 exch rl} def /pd {0 exch neg rl} def % these draw a line and "erase" across the background /ux {0 exch 2 copy gsave 1 setgray erase setlinewidth currentpoint .18 add moveto 0 setlinecap x grestore x } def /dx {neg 0 exch 2 copy gsave 1 setgray erase setlinewidth currentpoint .18 sub moveto 0 setlinecap x grestore x } def /rx {0 2 copy gsave 1 setgray erase setlinewidth currentpoint exch .18 add exch moveto 0 setlinecap x grestore x } def /lx {neg 0 2 copy gsave 1 setgray erase setlinewidth currentpoint exch .18 sub exch moveto 0 setlinecap x grestore x } def /dot { currentpoint newpath 0.150 0 360 arc fill } def /mdot { m dot} def % some small default circles /circ1 {gsave currentpoint newpath 0.20 0 360 arc whitefill line1 stroke grestore} def %for circle /circ2 {gsave currentpoint newpath 0.200 0 360 arc whitefill line2 stroke grestore} def %for complement /circ3 {gsave currentpoint newpath 0.8 0 360 arc line2 stroke grestore} def %for led /circ4 {gsave currentpoint newpath 0.33 0 360 arc whitefill line2 stroke grestore} def %for test point and switches % repeats [ proc distance trips] xrpt /xrpt{gsave aload pop /trips exch def /dist exch def /rproc exch def trips { gsave rproc grestore dist 0 translate } repeat grestore} def /yrpt{gsave aload pop /trips exch def /dist exch def /rproc exch def trips { gsave rproc grestore 0 dist translate } repeat grestore} def % some arrows . . . /uarrow {-.15 -.8 rlineto .3 0 rlineto closepath fill} def /darrow {gsave 180 rotate 0 0.8 rmoveto uarrow grestore} def /rarrow {gsave -90 rotate uarrow grestore} def /larrow { gsave 90 rotate uarrow grestore} def /whitefill { gsave 1 setgray fill grestore} def % ////////////////////////////////// % (5) electronics % . . . . . . % This section is being revised and improved % Opaque icons for use with the rubbergrid system. % This is older code that still needs rework. % In general, use -xpos- -ypos- iconname /electronics 200 dict def electronics begin /micro {font3 (m) show font1} def /ohms {font3 (W) show font1} def /tstpt {mt circ4 currentpoint 0.15 0 360 arc fill} def /xinv {0 1.25 rlineto 2.5 -1.25 rlineto -2.5 -1.25 rlineto closepath whitefill line2 stroke} def /rinverter{ mt gsave xinv grestore 2.7 0 rm circ2} def /linverter {mt gsave 180 rotate xinv grestore -2.7 0 rm circ2 } def /res {-0.8 0 rmoveto gsave 1.6 0 rlineto line1 1 setgray stroke grestore 0.10 0.3 rlineto 3 { .20 -.6 rlineto .20 .6 rlineto} repeat .20 -.6 rlineto 0.10 0.3 rlineto stroke} def /hresistor {mt res} def /vresistor { mt gsave 90 rotate res grestore} def /lpot { gsave translate gsave 0 -0.10 translate 0 0 vresistor grestore -.2 0 moveto rarrow grestore} def /cap {currentpoint 2 copy gsave 1 setgray 0 -.20 rlineto stroke grestore moveto -.6 0 rmoveto 1.2 0 rlineto stroke moveto 0 -1.2 rmoveto currentpoint newpath 1 55 125 arc stroke } def /vcap { mt cap } def /hcap { mt gsave 90 rotate cap grestore} def /uvcap { mt gsave 180 rotate cap grestore} def /schmitt {mt 0.3 0.3 rmoveto line1 -0.4 0 rlineto 0 -0.6 rlineto -.2 0 rlineto 0.4 0 rlineto 0 .6 rlineto stroke} def /dpdt {gsave translate 0 0 mt gsave newpath 0 0 mt 1 setgray 0.3 setlinewidth 0 2 rlineto 1.5 0 rlineto 0 -2 rlineto stroke grestore circ2 0 1 rm circ2 0 1 rm circ2 1.5 0 rm circ2 0 -1 rm circ2 0 -1 rm circ2 .2 setlinewidth 1 setlinecap -.35 .05 rm 1 u -.55 0 rm 1 d grestore} def /spdt { gsave translate 0 0 mt gsave newpath 0 0 mt 1 setgray 0.3 setlinewidth 0 2 rlineto 1.5 0 rlineto 0 -2 rlineto stroke grestore circ2 0 1 rm circ2 0 1 rm circ2 0.2 setlinewidth 1 setlinecap .45 0.05 mt 1 u grestore} def /diode{ currentpoint newpath moveto -.3 0 rmoveto gsave .7 -.4 rlineto 0 .8 rlineto closepath fill grestore -0.05 -.4 rmoveto 0 .8 rlineto 0.1 setlinewidth stroke } def /udiode { gsave moveto -90 rotate diode grestore } def /ddiode { gsave moveto 90 rotate diode grestore} def /led { mt currentpoint circ3 ddiode } def /negpulse { moveto -.35 .5 rmoveto .2 0 rlineto 0 -.5 rlineto 0.3 0 rlineto 0 .5 rlineto .2 0 rlineto stroke} def /pospulse { gsave 180 rotate negpulse grestore} def /5vdc {gsave 0 .8 rlineto currentpoint stroke .2 add 0.2 0 360 arc gsave 0.1 setlinewidth stroke grestore } def /xend { gsave -.1 0 rmoveto 0 .3 rlineto .2 0 rlineto 0 -.6 rlineto -.2 0 rlineto closepath gsave white fill grestore line1 stroke grestore} def /hxtal { mt gsave -.33 0 rmoveto 0.66 0 rlineto 0.3 setlinewidth 1 setgray stroke grestore gsave currentpoint exch -.35 add exch moveto xend 0.7 0 rmoveto xend grestore gsave 0 0.5 rmoveto 0 -1 rlineto 0.2 setlinewidth stroke grestore} def /sensor { gsave 2 copy vresistor .1 setlinewidth .5 sub newpath .6 0 -180 arcn 0 1.1 rlineto currentpoint stroke exch 0.6 add exch .6 180 0 arcn 0 -1.1 rlineto stroke grestore} def /ground { -.4 0 rmoveto 0.8 0 rlineto -.65 -0.2 rmoveto .5 0 rlineto -0.35 -0.2 rmoveto .2 0 rlineto stroke} def /uground {gsave 180 rotate ground grestore} def /lground {gsave -90 rotate ground grestore} def /rground {gsave 90 rotate ground grestore} def /dground {rground} def % old bug saved for old files /edgecon { gsave line2 mt 0 1.7 rm currentpoint newpath 0.3 180 0 arcn 1.7 d 0.6 l 1.7 u closepath gsave 1 setgray fill grestore stroke grestore} def /whitefill { gsave 1 setgray fill grestore} def /cell { gsave translate newpath 1 setgray 0 setlinecap 0 .3 mt 2 setlinewidth 0 -.6 rlineto stroke 0 setgray -.6 0.2 mt 0.3 setlinewidth 1.2 r stroke -1 -.3 mt line2 2 r grestore} def % //// DIPDRAW PROC ///// % dipdraw - draws a dip integrated circuit. (old code to be improved) % Enter with currentpoint set to pin 1 and scale % set so that 1.0 = distance between pins. Then % do a numpins-(name)-(hipins)-(lopins) dipdraw % Pin callouts preceeded by / will be complemented. % main dipdraw entry: /dipdraw { save /dipsnap exch def /hipins exch def /lopins exch def /chipname exch def /numpins exch def mark 0 0 0 0 0 0 0 0 0 0 0 0 % temp patch /howlong {numpins 2 div cvi 1 add} def /howhigh {4 numpins 36 ge {1 add} if} def /stub {howhigh 1.4 sub 2 div} def % internal service subs start here: /pinproc {numpins 2 div cvi{newpath 0 cpos 0.37 0 360 arc gsave 1 setgray fill grestore 0.067 setlinewidth stroke pin# 5 string cvs dup stringwidth pop 2 div neg cpos 0.2 sub moveto show 1 0 translate /pin# pin# dir add def} repeat } def /stretchprint { dup stringwidth pop 2 div neg exch length 1 sub stretch mul 2 div sub 0 moveto callout (/) anchorsearch true eq {currentpoint exch stretch add exch moveto pop dup /callout exch def stringwidth pop callout length 1 sub stretch mul add /barwide exch def 0.033 setlinewidth gsave currentpoint 0.55 add moveto barwide 0 rlineto stroke grestore} if stretch 0 callout ashow pop} def /pincallouts{0 vpos translate {workstring ( ) search true eq {/callout exch def pop /workstring exch def callout stretchprint 1 0 translate}{dup /callout exch def stretchprint exit } ifelse}loop} def % actual dipdraw process starts here: % ........ the outline: gsave 1 setlinecap 1 setlinejoin currentpoint translate newpath -.55 .45 0.15 0 360 arc fill newpath -1 howhigh 2 div 0.7 -90 90 arc 0 stub rlineto howlong 0 rlineto 0 howhigh neg rlineto howlong neg 0 rlineto closepath 0.36 setlinewidth stroke % ........ pin circles and numbers: /Helvetica-Bold findfont [0.4 0 0 0.55 0 0] makefont setfont gsave /pin# 1 def /dir 1 def /cpos 0 def pinproc grestore gsave /pin# numpins def /dir -1 def /cpos howhigh def pinproc grestore % pin callouts: /Helvetica findfont [0.35 0 0 0.6 0 0] makefont setfont /stretch 0.033 def gsave /workstring hipins def /vpos 0.6 def pincallouts grestore gsave /workstring lopins def /vpos howhigh 1.05 sub def pincallouts grestore % device number: /Helvetica-Bold findfont [1.4 0 0 1 0 0] makefont setfont /stretch 0.05 def gsave numpins 2 div 1 sub 2 div howhigh 2 div 0.33 sub translate chipname dup /callout exch def stretchprint grestore % end cleanup: grestore grestore cleartomark dipsnap restore} def % inductor stuff /lloop { .5 1 -.5 1 0 0 rcurveto} def /ltie {.2 -.30 .4 -.30 .6 0 rcurveto} def /lexit{.2 -.40 .4 0 .6 0 rcurveto .4 r } def /lentry {.4 r .2 0 .4 -.4 .6 0 rcurveto} def /hcoil { /numloops exch def lentry numloops 1 sub {lloop ltie} repeat lloop lexit} def /winding {gsave /numloops exch def translate 0 0 moveto 0 rotate numloops hcoil grestore} def /vwinding {gsave /numloops exch def translate 0 0 moveto 90 rotate numloops hcoil grestore} def /vrwinding {gsave /numloops exch def translate 90 rotate 1 -1 scale 0 0 moveto numloops hcoil grestore} def /phonejack {gsave translate 1 setlinecap 0 0 mt 0.15 u 3.85 r 0.3 d 3.85 l 3.95 0.15 mt 0.15 r 0.1 -0.15 rlineto -0.1 -0.15 rlineto 0.15 l 0.3 u 0.4 setlinewidth 2 setlinecap 0 0 mt 2 r 1 setlinecap 0 0.2 mt 2 r 0 -0.2 mt 2 r grestore } def /lilphonejack{ gsave translate 0.8 dup scale 0 0 phonejack grestore} def /varistor {gsave translate gsave -.5 0 mt 0.6 setlinewidth 1 setgray 1 r grestore line2 0.6 0.3 mt 1.2 l 0.6 -0.3 mt 1.2 l -0.45 -0.25 mt 0.3 0.50 rlineto 0.3 -0.50 rlineto 0.3 0.50 rlineto stroke grestore} def /piezo { gsave translate 0 0 mt gsave 5 dup scale circ1 grestore gsave 2.5 dup scale circ1 grestore grestore } def /pctab {gsave 1 setlinecap 1 setlinejoin line2 1 u 2 r 1 d 2 l grestore} def /npn {gsave newpath exch 0.2 sub exch translate -.1 0 1.2 0 360 arc gsave 1 setgray fill grestore line2 stroke -0.2 0 translate line3 -.3 -.7 moveto 1.4 u line1 -.3 0 mt 1.3 l -.2 .4 mt 0.6 0.4 rlineto 1.2 u newpath -.2 -0.4 mt 0.6 -0.4 rlineto 1.2 d newpath 0.4 -0.75 mt -.2 .3 rlineto -.2 -.3 rlineto closepath fill grestore} def /npnl {gsave translate -1 1 scale 0 0 npn grestore} def /pnp {gsave newpath exch 0.2 sub exch translate -.1 0 1.2 0 360 arc gsave 1 setgray fill grestore line2 stroke -0.2 0 translate line3 -.3 -.7 moveto 1.4 u line1 -.3 0 mt 1.3 l -.2 .4 mt 0.6 0.4 rlineto 1.2 u newpath -.2 -0.4 mt 0.6 -0.4 rlineto 1.2 d newpath -.2 .4 mt .3 .4 rlineto .1 -.3 rlineto closepath fill grestore} def /pnpl {gsave translate -1 1 scale 0 0 pnp grestore} def end % -- the electronics dictionary % ////////////////////////// % (6) arc justify - sets kerned circular text. % . . . . . % To use, -xpos -ypos- -radius- (message) karcjustify % A positive radius creates upward curving arcs. % A negative radius creates downward curving arcs. % Use -arckern- to stretch or compress global message. % Use -customkern- to adjust individual characters /arckern 1 def % global extra stretch + = stretch /customkern -1 def % custom extra squash - = squash /customkernchar (~) def % marker character to request custom kern /str (X) def /karcjustify {gsave /msg exch def /radius exch def translate msg stringwidth pop 0 msg {customkernchar 0 get eq {1 add} if} forall dup 0 gt {customkernchar stringwidth pop neg customkern add mul} if add msg length 1 sub arckern mul add 2 div dup 57.29578 mul radius div msg {str exch 0 exch put gsave rotate 0 radius moveto str dup dup dup customkernchar eq not {stringwidth pop 2 div 57.29578 mul radius div neg rotate show stringwidth pop}{customkern 2 div 57.29578 mul radius div neg rotate pop pop pop customkern} ifelse arckern add sub dup 57.29578 mul radius div grestore} forall pop pop grestore} def % //////////////// % (7) font eliminator % Font elimination completely eliminates the need for any strange % end user, editor, or typesetter run time fonts by substituting paths. % When *elimininatefonts* is called, all unbound *awidthshow* % commands will return font paths to host for recording and later % substitution. Level II only for capture. Two way comm essential. /eliminatefonts{ % shorter routine names used by font path procs... /mt {moveto} def /li {lineto} def % Note that lt and ln are spoken for! /ct {curveto} def /cp {closepath} def % optional time delay for host recording... /stall1 {50 {37 sin pop} repeat} def % optional stall % host reporting utility procs (currently 2 decimal place .XX accuracy) /prnum {index 100 mul round cvi 100 div ( ) cvs print ( ) print} def /prproc {0 index ( ) cvs print (\r) print flush stall1} def % this awidthshow diversion does all the actual work, returning all % widthshown font paths to the host for recording... /awidthshow {/str exch def /cys exch def /cxs exch def /sch exch def /sys exch def /sxs exch def str {currentpoint moveto (X) dup dup 4 -1 roll 0 exch put false charpath mark {/mt cvx 2 prnum 1 prnum prproc} {/li cvx 2 prnum 1 prnum prproc} {/ct cvx 6 prnum 5 prnum 4 prnum 3 prnum 2 prnum 1 prnum prproc} {/cp cvx dup prproc} pathforall ] cvx exec currentpoint fill moveto 0 get sch eq {currentpoint exch sxs add exch sys add moveto} if currentpoint exch cxs add exch cys add newpath moveto} forall } def} def % ////////////////////////////////// % (6) nuisance solvers % . . . . . . % nuisance - a dictionary of commonly used PostScript sequences % . . . . . . . . . . % nuisancedict is usually persistently downloaded as a subdictionary. % it is activated when needed by -- nuisance begin -- . 200 dict /nuisance exch def nuisance begin /acos {2 copy dup mul exch dup mul sub sqrt exch pop exch atan} def % arccosine use - xside hypotenuse acos - /asin {2 copy dup mul exch dup mul sub sqrt exch pop atan} def % arcsine use - yside hypotenuse asin - /backwards { 612 0 translate -1 1 scale} def % print backwards /bestgray {106 45 {dup mul exch dup mul add 1.0 exch sub} setscreen} def /black {0 setgray} def % draw in black /blackflash {0 0 moveto 1000 0 rlineto 0 1000 rlineto -1000 0 rlineto closepath fill showpage } def % black pre-page for highest print quality /boxdraw {bl bb bw bh brad roundbox blw setlinewidth stroke grestore } def % for old version compatibility % ///////////////////OLD ROUTINES NOT NOW IN USE///// % (2) boxdraw % . . . . . % This section is obsolete and will be phased out. use roundbox for % all new work % Draws various fancy boxes and sidebars, with or without % rounded corners and double hairlines /boxpath {/strt br bl add 2 div def /br {bl bw add} def % attempted repair /bc {bl bw 2 div add} def /bb {bt bh sub } def newpath strt bt moveto br bt br bb brad arcto br bb bl bb brad arcto bl bb bl bt brad arcto bl bt strt bt brad arcto closepath blw setlinewidth} def /br {bl bw add} def /bc {bl bw 2 div add} def /bb {bt bh sub} def %/boxdraw {boxpath stroke} def /boxfill {boxpath gsave fill grestore} def /hairdraw {gsave /hd exch def 0.5 setlinewidth bl bt hd sub moveto bw 0 rlineto 0 2.5 rmoveto bw neg 0 rlineto stroke} def /grabbox {/blw exch def /brad exch def /bh exch def /bt exch def /bw exch def /bl exch def} def /quickboxdraw {grabbox boxdraw} def /quickboxpath {grabbox boxpath} def /quickboxfill {grabbox boxfill} def % defaults /bl 200 def /bw 175 def /bt 500 def /bh 240 def /brad 7 def /blw 2 def /hd 25 def % use examples: boxdraw hd hairdraw -- draws the box and a title % boxpath -- generates only the path without stroking % gsave bl 10 add bb 15 add translate -- locks stuff % to inside of box; grestore exits % 200 175 500 240 7 2 quickboxdraw -- draws without % predefinition, but can't track inside height. /copies { /#copies exch def} def % as in -- 6 copies -- /feetfirst {180 rotate -612 -792 translate} def % eject print feet first /flushends {0 setlinecap} def % flush path ends /flushjoins {0 setlinejoin} def % flush path joins % GEniejul converts GEnie dates to Julian dates Enter with a six % digit integer; leave with date string on stack /GEniejul { ( ) cvs dup 2 2 getinterval cvi 1 sub [(January ) (February )(March )(April )(May )(June )(July )(August )(September ) (October )(November )(December )] exch get 1 index 4 2 getinterval (, ) mergestr mergestr exch 0 2 getinterval cvi dup 50 gt {1900} {2000}ifelse add ( )cvs mergestr} def % hrule does a fixed horizontal rule, given xstart ystart xend linewidth /hrule {gsave newpath setlinewidth 1 index 4 2 roll moveto lineto stroke grestore} def % vrule does a fixed vertical rule, given xstart ystart yend linewidth /vrule {gsave newpath setlinewidth 2 index 4 2 roll moveto exch lineto stroke grestore} def /inch {72 mul} def % inches /indiagray {135 35 {dup mul exch dup mul add 1.0 exch sub} setscreen} def /landscape {-90 rotate -792 0 translate} def % pick landscape printing /lightgray {0.99 setgray} def /listfonts {FontDirectory {pop == flush 200 {37 sin pop} repeat } forall} def % send installed font list to host /longjob {statusdict /waittimeout 180 put} def % lengthen job timeout /manual {statusdict /manualfeed true put} def % start manual feed % mergestr merges the two top stack strings into one top stack string /mergestr {2 copy length exch length add string dup dup 4 3 roll 4 index length exch putinterval 3 1 roll exch 0 exch putinterval} def /negative {{1 sub abs} settransfer} def % negative printing /outline {false charpath} def % finds character outline path /pi 3.1415926 def % you wanted rhubarb instead? /pixel {72 mul 300 div} def % 300 dpi only /positive {{} settransfer} def % restore positive printing /printfonts {/Helvetica findfont [10 0 0 10 0 0] makefont setfont /xpos 150 def /ypos 600 def /yinc 12 def xpos 20 sub ypos 20 add moveto (CURRENTLY INSTALLED FONTS:) show FontDirectory {pop 100 string cvs xpos ypos moveto (/) show show /ypos ypos 12 sub def} forall showpage} def % on paper /putridgray {53 45 {dup mul exch dup mul add 1.0 exch sub} setscreen} def /random {rand 65536 div 32768 div mul cvi} def % as in -- 6 random -- /report {== flush 100 {37 sin pop} repeat } def % top of stack to host /reprogray {85 35 {dup mul exch dup mul add 1.0 exch sub} setscreen} def % Romnum routine converts any number from 0-99 into its equivalent Roman % numerals. Enter with stack integer. Leave with stack Roman string. /Romnum { dup 10 div cvi [() (x) (xx) (xxx) (xl) (l) (lx) (lxx) (lxxx) (xc)] exch get ( ) cvs exch 10 mod cvi [() (i)(ii)(iii) (iv)(v)(vi)(vii)(viii)(ix)] exch get mergestr} def /roundends {1 setlinecap} def % rounded path ends /roundjoins {1 setlinejoin} def % rounded path joins % This creates a rounded path from -radius- [x1 y1 x2 y2 ... xn yn] % roundpath. Does NOT round path ends. Use roundbox for boxes /roundpath {/rpdata exch def /rprad exch def rpdata length 1 sub cvi /rppoints exch def rpdata 0 get rpdata 1 get moveto 2 2 rppoints 2 sub {/rpvalue exch def 0 1 3 {rpdata exch rpvalue add get } for rprad arcto pop pop pop pop} for rpdata rppoints 1 sub get rpdata rppoints get lineto} def % roundbox draws a box path with rounded corners and locks you to the % lower lefthand box corner using this format ... % -xpos- -ypos- -xwidth- -yheight- -cornerrad- roundbox /roundbox {gsave /rad exch def /bt exch def /br exch def /bb exch def /bl exch def bl bb translate rad mark br 2 div 0 0 0 0 bt br bt br 0 br 2 div 0] roundpath /bc br bl sub 2 div def} def /snoop {1183615869 internaldict begin} def % activates superexec /stockends {2 setlinecap} def % default path ends /stockjoins {2 setlinejoin} def % default path joins /stall {{37 sin pop} repeat} def % delay as in -- 1500 stall -- % timing utilities. use stopwatchon and stopwatchoff for simple % one shot timing. For multiple time totals, use resettimer % starttimer stoptimer ... starttimer stoptimer reporttimer /stopwatchoff {stoptimer reporttimer} def % for single shots /stopwatchon {resettimer starttimer} def % for single shots /reporttimer {mytime 1000 div (\rElapsed time: ) print 20 string cvs print ( seconds.\r) print flush} def % to host /resettimer {/mytime 0 def} def % reset timer /starttimer {usertime /mytimenow exch def} def % add to time so far /stoptimer {usertime mytimenow sub /mytime exch mytime add def} def % for multiple timing intervals % stringdown, et al repeats a string of one or more characters to form % a fancy border. use -#repeats- -spacing- (char) stringdown, etc. /stringdown {/char exch def /vcharsp exch def {gsave char show currentpoint vcharsp sub moveto} repeat} def /stringleft {/char exch def /hcharsp exch def {gsave char show currentpoint exch hcharsp sub exch moveto} repeat} def /stringright {/char exch def /hcharsp exch def {gsave char show currentpoint exch hcharsp add exch moveto} repeat} def /stringup {/char exch def /vcharsp exch def {gsave char show currentpoint vcharsp add moveto} repeat} def % superstroke and superinsidestroke take a predefined path and a % top-of-stack array of [width1 gray1 width2 gray2 .... widthn grayn] % and do multiple strokes for wires, fancy borders, or braiding. % Note that the FIRST array value pair has to be the WIDEST, etc. % Use superstroke for wires; superinsidestroke for borders. /superstroke { save /sssnap exch def /sscmd exch def mark 0 2 sscmd length 2 div cvi 1 sub 2 mul {/aposn exch def gsave sscmd aposn get setlinewidth sscmd aposn 1 add get setgray stroke grestore} for cleartomark sssnap restore newpath} def /superinsidestroke {save clip /sssnap exch def /sscmd exch def mark 0 2 sscmd length 2 div cvi 1 sub 2 mul {/aposn exch def gsave sscmd aposn get 2 mul setlinewidth sscmd aposn 1 add get setgray stroke grestore} for cleartomark sssnap restore newpath} def /tan {dup sin exch cos dup 0 eq {pop 0.000001} if div} def % tangent /tray {statusdict /manualfeed false put} def % stop manual feed /white {1 setgray} def % print in white /width {stringwidth pop} def % finds x width of string end % the nuisance dictionary % ////////////////////////// % (9) switchable error trapper % . . . . . % Creates a printing error trapper that dumps the stack and prints what you % have accomplished so far. While EXTREMELY useful, this is definitely NOT % to be a replacement for true two-way comm. Adapted from EHANDLER.PS. % Use gutil begin printerror at the start of your file for time-of-error % printout and stack dump /printerror {/$brkpage 64 dict def $brkpage begin /prnt {dup type/stringtype ne{=string cvs}if dup length 6 mul /tx exch def/ty 10 def currentpoint/toy exch def/tox exch def 1 setgray newpath tox toy 2 sub moveto 0 ty rlineto tx 0 rlineto 0 ty neg rlineto closepath fill tox toy moveto 0 setgray show}bind def /nl{currentpoint exch pop lmargin exch moveto 0 -10 rmoveto}def /=={/cp 0 def typeprint nl}def /typeprint{dup type dup currentdict exch known {exec}{unknowntype}ifelse}readonly def /lmargin 72 def /rmargin 72 def /tprint {dup length cp add rmargin gt{nl/cp 0 def}if dup length cp add/cp exch def prnt}readonly def /cvsprint{=string cvs tprint( )tprint }readonly def/unknowntype{exch pop cvlit(??)tprint cvsprint}readonly def/integertype{cvsprint}readonly def/realtype{cvsprint}readonly def /booleantype{cvsprint}readonly def/operatortype{(//)tprint cvsprint} readonly def/marktype{pop(-mark- )tprint}readonly def/dicttype{pop (-dictionary- )tprint}readonly def/nulltype{pop(-null- )tprint}readonly def/filetype{pop(-filestream- )tprint}readonly def/savetype{pop (-savelevel- )tprint}readonly def/fonttype{pop(-fontid- )tprint}readonly def/nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def/stringtype {dup rcheck{(\()tprint tprint(\))tprint}{pop(-string- )tprint}ifelse }readonly def/arraytype{dup rcheck{dup xcheck{({)tprint{typeprint} forall(})tprint}{([)tprint{typeprint}forall(])tprint}ifelse}{pop (-array- )tprint}ifelse}readonly def/packedarraytype{dup rcheck{dup xcheck{({)tprint{typeprint}forall(})tprint}{([)tprint{typeprint} forall(])tprint}ifelse}{pop(-packedarray- )tprint}ifelse}readonly def /courier/Courier findfont 10 scalefont def/OLDhandleerror errordict /handleerror get def end errordict /handleerror {systemdict begin $error begin $brkpage begin newerror{/newerror false store $error /errorname get (ioerror) ne $error /command get (exec) ne or {vmstatus pop pop 0 ne{grestoreall}if initgraphics courier setfont lmargin 720 moveto (ERROR: )prnt errorname prnt nl(OFFENDING COMMAND: )prnt/command load prnt $error/ostack known {nl nl(STACK:)prnt nl nl $error/ostack get aload length{==}repeat}if systemdict/showpage get exec /newerror true store/OLDhandleerror load end end end exec}{end end end} ifelse} {end end end}ifelse} dup 0 systemdict put dup 4 $brkpage put bind readonly put} def % ////////////////////////////////// end % the entire utility dictionary, except for gonzo justification %%%%%%%///////// % X E % Z % (11) Gonzo justification tools ... % ************************************************************************ % ************************************************************************ % GONZO 13 JUSTIFICATION POWER TOOL % ************************************************************************ % % SUMMARY: Exceptionally high quality, fully device independent, and ultra % fast (but non-WYSIWYG) Don Lancaster text justification routines. % % Includes auto drop caps, hanging punctuation, global kerning, % supertabs, callout modes, overstrikes, menu justify, scads more. % % Gonzo can also dump plain old ASCII text and can custom % emulate nearly anything. % % Gonzo is fully open, unlocked, documented, and reprogrammable. % % Reprinted from Don Lancaster's POSTSCRIPT BEGINNER STUFF. % % Copyright c 1991 by Don Lancaster. All rights fully reserved. % Free help line and additional info: (602) 428-4073. % % ************************************************************************ % Name of textfile: GONZO15A.PTL % Source: SYNERGETICS % Author: Don Lancaster % Desc: Superb quality text justification % Date: September 15, 1992 % Release: 15a (GEnie alpha "B" release) % Approx length: 46K % Status: Copyright 1990 by Don Lancaster and Synergetics. % 3860 West First Street, Thatcher, AZ. (602) 428-4073. % All commercial rights reserved. Personal use permitted % so long as this status message stays present and intact. % Gonzo POSTSCRIPT BEGINNER STUFF package $39.50 VISA/MC. % % Keywords: PostScript, gonzo, justification, compile, text % Approximate NTX run time: 2.50 seconds per 1000 chars (uncompiled) % 0.33 seconds per 1000 chars (compiled) % X E Activate XON/XOFF if necessary. % Z Values are shown for Apple Super Serial Card %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % WARNING: This is the GEnie "alpha" release. The compile, supertab, % and menu justify features are not yet all there. % % KEEP A WRITTEN USER LOG AND EXPECT PROBLEMS. % % Report problems, corrections, questions, etc, to PSRT. % % For further documentation, see PSRT #220 GONZO13A.TXT. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % GONZOJST.PTL is a series of utilities that allow ultra high quality % text justification from within a word processor or editor environment. % The routines are fast, fully programmable, use minimum length files, and % use little VM. They are purposely not WYSIWYG for maximum flexibility, % speed, and total device independence. Advanced features include auto drop % caps, hanging punctuation, individual kerning, lastline stretch, simple % textdumper, callout modes, macros, overstrike, and much more. The routines % be used WITHOUT control characters. They can emulate nearly anything. % An internal compiler is included for extremely fast rerun times. % Full use instructions appear in the companion file GONZO13A.TXT. % Also see the internal notes and comments below. % Status: Copyright 1990 by Don Lancaster and Synergetics. % 3860 West First Street, Thatcher, AZ. (602) 428-4073. % All commercial rights reserved. Personal use permitted % so long as this status message stays present and intact. % Gonzo POSTSCRIPT BEGINNER STUFF package $39.50 VISA/MC. % create a working dictionary that remains closed until needed ... 1000 dict /gonzo exch def gonzo begin % USER ALTERABLE COMMANDS - all must remain here as defaults % ======================= /altescapechar 124 def % alternate "escape" key for commands (|) /cstretch 0.2 def % minimum character kerning /colcheck { } def % link to page or column maker /dropcount 3 def % lines indented for drop cap /dropindent 40 def % width reserved for drop cap /escapechar 27 def % "escape" key for commands - can be printable /gonzocompile false def % compile to host or disk flag /gonzojust true def % allow gonzo commands? (false for text dumper) /hangflag true def % hang center, right, or fill punctuation? /hangfract 0.6 def % amount that hung punctuation hangs /hostcompdelay 80 def % optional compiling character report delay /justifylastline false def % fill justify last paragraph line? /justx (justL) def % running justification mode /kern 1 def % default individual kern amount /lastlinestretch 0.12 def % stretch on last line of fill just paragraph /oktoadvance true def % don't advance to next line if false /oktoprint true def % print suppression flag /overstrikechar (\320) def % overstrike character /overstrikeht 5.5 def % vertical shift of overstrike character /pm 10 def % normal paragraph indent /rslashchar 92 def % "reverse slash" key -alterable- /rslashok true def % allow reverse slash processing? /stringmode false def % string or currentfile source? /spacecharratio 6 def % fill justify ratio of space to char stretch /sstretch -0.3 def % minimum space kerning - may be negative /tabs [50 100 150 200] def % default tab list /txtwide 350 def % width of column /txtwideadj {} def % custom proc for keystoning, etc. /xpos 70 def % horizontal start of text /yinc 11 def % line spacing /ypara 0 def % additional v space at paragraph end /ypos 400 def % vertical start of text /ytop 720 def % default top reference for template /ybot -9999 def % default bottom reference for template % GONZOFONT BUILDER % ================= % gonzo fontnames MUST be of form /fontx, where x is any printable ASCII % character that has also been "qualified" to be a font in the command list. % A later gonzofont command rapidly sets the font and defines the space width. % gonzofont accepts either % /font1 /Helvetica 12 gonzofont -- or else -- % /font1 /Helvetica [wide climb slant high xshift yshift] gonzofont /gonzofont {dup type cvlit /arraytype eq {exch findfont exch makefont} {exch findfont exch scalefont} ifelse setfont mark /spacewidth ( ) stringwidth pop /cstretch cvx /add cvx /sstretch cvx /add cvx /def cvx currentfont dup backcdict exch (F?) dup 1 14 index (xxxxx) cvs 4 get put put /setfont cvx ] cvx def} def 50 dict /backcdict exch def % used "backwards" during compiling to get % fontname given the "made" font dictionary % USER FONTS - all should remain here as defaults ... % ========== /font0 /Helvetica-Bold [36 0 0 40 0 0] gonzofont % for drop caps /font1 /Helvetica 9 gonzofont % regular text /font2 /Helvetica-BoldOblique 9 gonzofont % reg italic /font3 /Helvetica-Bold 9 gonzofont % reg bold /font4 /Helvetica 8 gonzofont % reg all caps or #s /font5 /Helvetica-BoldOblique 8 gonzofont % italic all caps or #s /font6 /Helvetica-Bold 8 gonzofont % bold all caps or #s /font7 /Helvetica-Bold [6 0 0 6 0 -2] gonzofont % subscript /font8 /Helvetica-Bold [6 0 0 6 0 4] gonzofont % superscript /font9 /Helvetica-Bold [9 0 0 9 0 4] gonzofont % lowered bold title /font- /ZapfDingbats 9 gonzofont % Dingbats /font= /Symbol 9 gonzofont % Greek & Math /font: /Courier 9 gonzofont % Spare /font; /Courier 10 gonzofont % Spare /font+ /Courier 11 gonzofont % Spare font1 % set default % SYSTEM CONSTANTS - not normally altered % ================ /maxcharsbeforecr 6000 def % maximum number of characters before a cr /linestring1 maxcharsbeforecr string def % main for normal use /linestring2 maxcharsbeforecr string def % aux to allow headers /linestring linestring1 def % default /templatestartup {} def % default /maxprocsperline 200 def % maximum number of procs per print line /printlist maxprocsperline array def /dropflag false def % dropcap flag % /exitcheck {} def % default exit (overwritten by dump template) /firstchar 0 def % first character pointer /numspaces 0 def % initial number of spaces in line /pmrun 0 def % running paragraph margin /templatestartup {} def % link to template initializer % stack conventions during gonzojustify: all procs must restore % top stack value = next available position in linestring % next stack value = next available position in printlist % COMMAND LIST: % ============ % This command list determines the action of each [esc] selection. % First, create the list . . . /commands 256 array def 0 1 255 {commands exch {} put} for % You can have as many fonts as you like, trading off room for other % commands. Note that font1 is ASCII 49 and so on. % Here are the current font character definitions. . . commands (0) 0 get {font0} put commands (1) 0 get {font1} put commands (2) 0 get {font2} put commands (3) 0 get {font3} put commands (4) 0 get {font4} put commands (5) 0 get {font5} put commands (6) 0 get {font6} put commands (7) 0 get {font7} put commands (8) 0 get {font8} put commands (9) 0 get {font9} put commands (:) 0 get {font:} put commands (;) 0 get {font;} put commands (=) 0 get {font=} put commands (-) 0 get {font-} put commands (+) 0 get {font+} put % justification modes for command list commands (C) 0 get {justx 4 (C) 0 get put} put % center justify commands (F) 0 get {justx 4 (F) 0 get put} put % fill justify commands (L) 0 get {justx 4 (L) 0 get put} put % left justify commands (R) 0 get {justx 4 (R) 0 get put} put % right justify commands (P) 0 get {justx 4 (P) 0 get put} put % programmable just #1 commands (Q) 0 get {justx 4 (Q) 0 get put} put % programmable just #2 % macros for command list commands (a) 0 get {amacro} put commands (b) 0 get {bmacro} put commands (c) 0 get {cmacro} put commands (d) 0 get {dmacro} put commands (e) 0 get {emacro} put commands (f) 0 get {fmacro} put commands (U) 0 get {Umacro} put commands (V) 0 get {Vmacro} put commands (W) 0 get {Wmacro} put commands (X) 0 get {Xmacro} put commands (Y) 0 get {Ymacro} put commands (Z) 0 get {Zmacro} put % service routines for command list commands (h) 0 get {halflinefeedup} put % half linefeed up commands (i) 0 get {initialcap} put % initial dropcap commands (j) 0 get {kern+} put % positive kerning commands (k) 0 get {kern-} put % negative kerning commands (l) 0 get {linefeeddown} put % linefeed down commands (n) 0 get {nobreak} put % conditional ff commands (o) 0 get {overstrike} put % overstrike char commands (p) 0 get {/pmrun pm def} put % normal para indent commands (s) 0 get {/ypos -10000 def} put % showpage formfeed template link commands (t) 0 get {plainoldtab} put % simple tabbing commands (x) 0 get {exitproc} put % exit to PostScript commands (y) 0 get {fulllinefeedup} put % negative linefeed commands (z) 0 get {/pmrun 0 def} put % zero para indent % EXPANDED SERVICE ROUTINE DEFINITIONS % ==================================== /halflinefeedup {/ypos ypos yinc 2 div add def} def /fulllinefeedup {/ypos ypos yinc add def} def /linefeeddown {/ypos ypos yinc sub def} def /nobreak {ypos yinc 6 mul sub ybot lt {/ypos ybot def} if} def /initialcap {/ypos ypos yinc add ypara add def /pmrun 0 def /indentcount dropcount def /dropflag true def} def % a simple tab routine for lj only. Tabs relative to xpos /plainoldtab {tabs tabcount get dup /roomleft exch txtwide exch sub def mark exch xpos add ypos /moveto cvx] cvx printlist exch 3 index exch put exch 1 add exch tabcount tabs length 1 sub lt {/tabcount tabcount 1 add def} if } def /kern- {mark kern neg 0 /rmoveto cvx ] cvx printlist exch 3 index exch put /roomleft roomleft kern add def exch 1 add exch} bind def /kern+ {mark kern 0 /rmoveto cvx ] cvx printlist exch 3 index exch put /roomleft roomleft kern sub def exch 1 add exch} bind def /overstrike {printlist 2 index 1 sub get aload pop pop pop add 1 sub linestring exch 1 getinterval stringwidth pop dup overstrikechar stringwidth pop sub 2 div sub mark exch /gsave cvx exch /cfix cvx /add cvx /neg cvx overstrikeht /rmoveto cvx overstrikechar /rshowchars cvx /grestore cvx] cvx printlist exch 3 index exch put exch 1 add exch} def % stringmacro lets you do a series of gonzolink commands with a single % macro keystroke. For instance, /amacro {(z3c) stringmacro} def picks % a centered font3 with no paragraph for an embedded [esc]-a. /stringmacro { {commands exch get exec} forall} def % This lets you use [esc]-g instead of startgonzo (\033g) cvn {startgonzo} def (|g) cvn {startgonzo} def % CHARACTER COMMAND ARRAY (fake CASE) % ======================= % create an executable array based on character to decide who does what /chararray 256 array def % decides action of each key 0 1 255 { /posn exch def chararray posn [posn /chartolinestring cvx ] cvx put} for % default 1:1 mapping chararray dup 0 {} put dup 10 {newlineproc} put % lf newline dup 13 {newlineproc.wcrlf} put % cr as newline dup 32 {spaceproc} put % spaceproc dup escapechar {gonzojust {escproc}{exitcheck} ifelse} put % escape key dup altescapechar {gonzojust {escproc}{exitcheck} ifelse} put % altesc key dup rslashchar {rslashok {rslashproc} {rslashchar chartolinestring} ifelse} put % rslash key - can alter pop %%%%% CR-LF ATTEMPTED PATCH %%%%% % This ignores a cr if the next character is a linefeed /newlineproc.wcrlf{ stringmode {getstringchar}{currentfile read} ifelse % read next w end check { % true-false on valid read dup 10 eq {pop newlineproc } % if cr-lf {/crlfhold exch store newlineproc chararray crlfhold get exec } % if not ifelse } % if a character followed cr {newlineproc exit} ifelse % if cr was the last character } def %%%%%%%%%%%%%% % Charproc simply piles up characters into linestring. % Other commands decide how these characters are to be used. /chartolinestring {linestring exch 2 index exch put 1 add } bind def % exitproc responds to [esc]-x and gets you out of gonzo after printing. /exitproc {exit} def % rslashproc takes care of the reverse slashes which are not active when % not reading strings. Modified to reject cr-lf pairs % create an action array /slashlist 256 array def 0 1 255 {slashlist exch {} put} for slashlist dup 48 {0 octalnum} put % process as octal number dup 49 {1 octalnum} put dup 50 {2 octalnum} put dup 51 {3 octalnum} put dup 40 {40 chartolinestring} put % left paren dup 41 {41 chartolinestring} put % right paren dup 92 {92 chartolinestring} put % reverse slash dup 114 {chararray 13 get exec} put % carriage return dup 108 {chararray 10 get exec} put % linefeed dup 116 {slashtab} put % tab someday dup 98 {slashbs} put % backspace someday dup 102 {slashformfeed} put % formfeed someday pop /slashtab {nogot} def /slashbs {nogot} def /slashformfeed {nogot} def /nogot {reverse_slash _feature_not_yet_defined} def /rslashproc { % modified to reject cr-lf pairs stringmode {getstringchar}{currentfile read} ifelse {dup 13 eq { pop stringmode {getstringchar}{currentfile read} ifelse % char after cr {dup 10 ne { chararray exch get exec}{pop} ifelse } {pop exit} ifelse % if out of chars } % if cr {slashlist exch get exec} % if not cr ifelse } {exit} ifelse } % if no more chars bind def % octalnum handles all reverse slashes followed by three octal nuambers. /octalproc { stringmode {getstringchar}{currentfile read} ifelse { 48 sub dup dup 0 lt exch 7 gt or {pop 0} if} {exit} ifelse} def /octalnum {8 mul octalproc add 8 mul octalproc add chararray exch get exec} bind def % TXTWIDE FITTING SERVICE UTILITIES % ================================= % longstringadj currently lets an all print string longer than % txtwide invade the margin, rather than forcing a break or error /longstringadj {dup txtwide ge {pop txtwide 10 div} if} bind def % doeswordfit attempts to add the length of the current trial word to % the present line. It returns a positive value if room remains and % a negative one if not. /doeswordfit {linestring wordstart dup 3 index exch sub getinterval dup dup length 0 gt {stringwidth pop exch length cstretch mul add /wordroom exch def} {pop pop /wordroom 0 def} ifelse roomleft wordroom longstringadj sub dup 0 gt} bind def % tryspacefit attempts to add a space to the end of the existing word. % if it fits, word is accepted. If not, line ends. /tryspacefit {roomleft spacewidth sub dup 0 ge {/roomleft exch def dup 1 add dup /oktohere exch def /wordstart exch def 1 add /numspaces numspaces 1 add def} {pop /wordroom 0 def /oktohere oktohere 1 add def substart dup oktohere sub neg wordtoplist exch /plistlength exch def 0 exch endtheline /wordstart oktohere def startnextline} ifelse } bind def % wordtoplist adds word to printlist if positive length. Start out with % -plistpoint- -charpoint- -startchar- -length- on stack. End with % new word grouip in print array and -newplist- -charpoint-. /wordtoplist {dup 0 gt {mark 3 1 roll dup numchars add /numchars exch def currentfont /showchars cvx ] cvx printlist exch 3 index exch put exch 1 add exch } {pop pop} ifelse } bind def % *** ESCPROC *** % On an escape (or substitute escape) command character ... % yes ------ previous word fit? -------- no % word to printlist closeline % do escape command word to next line always % word to new printlist % do escape command /escproc { doeswordfit {/roomleft exch def dup dup /oktohere exch def /wordstart exch def substart dup oktohere sub neg wordtoplist} {pop substart dup oktohere sub neg wordtoplist exch /plistlength exch def 0 exch endtheline startnextline dup dup /oktohere exch def /wordstart exch def substart dup oktohere sub neg wordtoplist /firstchar -1 def } ifelse /substart oktohere def commands stringmode {getstringchar}{currentfile read} ifelse {get exec}{exit} ifelse } bind def % *** NEWLINEPROC *** % On as carriage return or newline character ... % yes ------ previous word fit? -------- no % update word closeline % closeline word to next line always % closeline /newlineproc {doeswordfit {/roomleft exch def dup dup /oktohere exch def /wordstart exch def substart dup oktohere sub neg wordtoplist /lastparline true def exch /plistlength exch def 0 exch endtheline /wordroom 0 def /firstparline true def startnextline} % word did fit on line {pop substart dup oktohere sub neg wordtoplist exch /plistlength exch def 0 exch endtheline startnextline dup dup /oktohere exch def /wordstart exch def substart dup oktohere sub neg wordtoplist /lastparline true def exch /plistlength exch def 0 exch endtheline /firstparline true def /wordroom 0 def startnextline % word did not fit on line } ifelse pop 0 /substart 0 def /wordstart 0 def /oktohere 0 def /firstchar -1 def} bind def % *** SPACE PROC *** % Leading spaces are ignored in an ongoing paragraph with the firstchar test. % For speed, "words" may include internal spaces if there is enough room. % % yes ------ previous word fit? -------- no % update word closeline % yes --- word+space fit? -- no word to next line always % update word closeline yes -- word+space fit? --- no % update word closeline /spaceproc { dup firstchar ne {linestring 1 index 32 put doeswordfit {/roomleft exch def dup 1 sub /oktohere exch def tryspacefit} {pop substart dup oktohere sub neg wordtoplist exch /plistlength exch def 0 exch endtheline startnextline tryspacefit} ifelse} if} bind def % *** SWALLOW AND HANG *** % swallowandhang is a dual purpose proc that swallows any trailing spaces % and optionally hangs punctuation for center, right, and fill justification. % The swallowlist decides which characters get acted on for hanging. % The "1" before the hung character lets you individually customize overhang. % hangfract lets you adjust the overhang of all characters together. /swallowlist 256 array def 0 1 255 {swallowlist exch {exit} put} for swallowlist dup ( ) 0 get {swallow} put dup (-) 0 get {1 (-) hangpunct} put dup (.) 0 get {1 (.) hangpunct} put dup (,) 0 get {1 (,) hangpunct} put dup (;) 0 get {1 (;) hangpunct} put dup (:) 0 get {1 (:) hangpunct} put dup (") 0 get {1 (") hangpunct} put dup (') 0 get {1 (') hangpunct} put dup (}) 0 get {1 (}) hangpunct} put dup 41 {1 (\051) hangpunct} put % closing parenthesis dup 177 {1 (\261) hangpunct} put % em dash dup 208 {1 (\320) hangpunct} put % en dash dup 186 {1 (\272) hangpunct} put % closing double quote pop % hangpunct shortens roomleft if hanging is wanted. /hangpunct { hangflag { stringwidth pop mul hangfract mul roomleft exch add /roomleft exch def} {pop pop} ifelse exit } bind def % swallow removes one leading space /swallow {/lopspaces lopspaces 1 add def} bind def % swallowandhang first tests for a normal showchars ending. It then runs % sandh to do the actual swallowing or punctuation hanging. /swallowandhang { printlist plistlength 1 sub get dup dup length 4 eq {3 get cvlit /showchars eq {sandh}{pop pop} ifelse} {pop pop} ifelse } bind def % sandh grabs the last string of characters and works backwards through % them, providing a count of total trailing spaces, and hanging selected % punctuation. The roomleft is then adjusted accordingly. /sandh {/lopspaces 0 def dup 0 get exch 1 get linestring 3 1 roll getinterval /laststring exch def laststring length 1 sub -1 0 {laststring exch get swallowlist exch get exec} for /roomleft lopspaces spacewidth mul roomleft add def /numchars numchars lopspaces sub def /numspaces numspaces lopspaces sub def} bind def % *** LINE CONTROLS ****** % startnextline resets pointers, handles indents, sets up first move. /startnextline { oktoadvance {/ypos ypos yinc lastparline {ypara add} if sub def } if % move to next line colcheck % link to page template /lastparline false def % can't be the last line /substart wordstart def % point to start of current word /numspaces 0 def % character+space line count /numchars 0 def % space line count /tabcount 0 def % tab count 0 firstparline {pmrun add /firstparline false def} if % pm indent? dropflag {dropcount 0 ge {dropindent add /dropcount dropcount 1 sub def dropcount 0 eq {/dropflag false def} if} if} if % indent dropcap? dup wordroom add neg txtwide add txtwideadj /roomleft exch def printlist 0 [ 3 index /xymove cvx ] cvx put pop exch pop 1 exch dup /firstchar exch def} bind def % endtheline executes a justify proc to set xfix, yfix, cfix and sfix % and then conditionally prints the printlist ... /endtheline { justx cvx exec oktoprint {printline} if} bind def % *** JUSTIFY PROCS ******** % The justify procs take the character count, the space count, and roomleft % and convert these into xfix and yfix entire line offsets and % cfix and sfix character and space kerning. /justC {swallowandhang /sfix sstretch def /cfix cstretch def /xfix roomleft 2 div def /yfix 0 def} bind def /justF {lastparline {justifylastline {reallyjustF} {justL adjustlastline} ifelse }{reallyjustF} ifelse} bind def /justL {/sfix sstretch def /cfix cstretch def /xfix 0 def /yfix 0 def} bind def /justR {swallowandhang /sfix sstretch def /cfix cstretch def /xfix roomleft def /yfix 0 def} bind def /reallyjustF {swallowandhang roomleft numchars 1 sub numspaces spacecharratio mul add dup 0 eq {pop 0.001} if div dup cstretch add /cfix exch def spacecharratio mul sstretch add /sfix exch def /xfix 0 def /yfix 0 def} bind def % unconditional justF % optional additional final line stretch is used only if it uses up less % than 80 percent of the remaining room. Otherwise might look cramped /adjustlastline { numchars 1 sub numspaces spacecharratio mul add lastlinestretch mul roomleft 0.8 mul lt {/cfix cfix lastlinestretch add def /sfix sfix lastlinestretch spacecharratio mul add def} if} def % *** PRINT MODULE ******** % printline accepts a series of procs from the printlist and executes them % It expects a printlist of form [{proc1}{proc2}{proc3}...{procn] and % these variables predefined ... % plistlength % length of printlist % sfix % total space kerning for line % cfix % total character kerning for line % xfix % total x-shift for line (for centering, rj, etc.) % yfix % total y-shift for line (normally zero) % indent % first line or drop cap indent /sfix 0 def /cfix 0 def /xfix 0 def /yfix 0 def % defaults /printline {gsave 0 1 plistlength 1 sub {printlist exch get exec} for grestore} bind def % some often-used print-time macros . . . % -stringstart- -stringlength- -madefontdict- showchars --> images string at % the currentpoint. /showchars { setfont linestring 3 1 roll getinterval sfix 0 32 cfix 0 6 -1 roll awidthshow1} bind def /rshowchars {show1} def % overstrike to compile link % -indent- xymove ---> does absolute move to xpos + indent, ypos /xymove {xpos add xfix add ypos yfix add moveto} bind def % these two links have to stay unbound for Distillery or self-compiling /show1 {show} def /awidthshow1 {awidthshow} def % %%% MAIN GONZO JUSTIFY ROUTINE %%% % startgonzo reads the currentfile, either piling up printable characters % into linestring, or acting out escape or space commands. % and here's gonzo ... /initgonzostuff { /wordroom 0 def /firstparline true def /lastparline false def /wordstart 0 def /substart 0 def /roomleft txtwide def /oksofar 0 def /numchars 0 def /lopcount 0 def /firstchar -1 def /tabcount 0 def /gotcr false def } bind def /startgonzo {initgonzostuff 0 0 printlist 2 index [0 /xymove cvx] cvx put exch 1 add exch {currentfile read {chararray exch get exec}{exit} ifelse} loop pop pop % remove pointers from stack } bind def % stringgonzo is similar to startgonzo, except that it accepts an % input string instead of the currentfile. This is handy for deferred % or predefined uses. stringgonzo is significantly (25%) slower than % startgonzo. An extra carriage return is always added to the string end. % to make sure the last line prints. % Current bugs: can't embed printable \ with \\ or \134 and an extra % carriage return or double space MUST follow stringgonzo to stay error free. /stringgonzo {initgonzostuff dup length 1 add dup /gslen exch def string dup /gonzostring exch def exch 0 exch putinterval gonzostring gslen 1 sub 13 put /gsptr 0 def /stringmode true def 0 0 printlist 2 index [0 /xymove cvx] cvx put exch 1 add exch {getstringchar {chararray exch get exec}{exit} ifelse} loop pop pop /stringmode false def } bind def /getstringchar {gsptr gslen ge{ false } {gonzostring gsptr get true} ifelse /gsptr gsptr 1 add def} bind def % CALLOUT JUSTIFY MODES % cl accepts an input of form xpos ypos (message) cl and shows it % at xpos left and within xpos + textwide right. /cl {save /snapcl exch def /linestring linestring2 def /justx (justL) def 3 1 roll /ypos exch def /xpos exch def stringgonzo snapcl restore} def % cf accepts an input of form xpos ypos (message) cf and shows it % flush left at xpos and flush right at xpos + textwide. /cf {save /snapcf exch def /linestring linestring2 def /justx (justF) def 3 1 roll /ypos exch def /xpos exch def stringgonzo snapcf restore} def % cc accepts an input of form xpos ypos (message) cc and centers it % on xpos. txtwide IS IGNORED, AND ANY WIDTH WILL GET CENTERED. /cc {save /snapcc exch def /linestring linestring2 def /txtwide 5000 def /justx (justC) def /pmrun 0 def 3 1 roll /ypos exch def 2500 sub /xpos exch def stringgonzo snapcc restore} def % cr accepts an input of form xpos ypos (message) cr and sets it % flush right against xpos. txtwide IS IGNORED, AND ANY WIDTH % WILL SET FLUSH RIGHT. /cr {save /snapcm exch def /linestring linestring2 def /txtwide 5000 def /justx (justR) def /pmrun 0 def 3 1 roll /ypos exch def 5000 sub /xpos exch def stringgonzo snapcm restore} def % COMPILING ROUTINES % Compiling can be done either to the host (using a two way comm % channel or to hard disk. The compiled files are Adobe Distillery % compatible but slightly shorter and faster. They can be further % sped up and shortened with an add-on utility. % To compile, issue a compiletohost or a compiletodisk after beginning % gonzo. /compiletohost {/hostcompflag true def sendcompileheader} def /compiletohost {/diskcompflag true def sendcompileheader} def /send { dup hostcompflag { print flush hostcompdelay {37 sin pop} repeat}{pop} ifelse dup diskcompflag { writehere }{pop} ifelse pop } def % TEMPLATE LOADER % starttemplate opens a template whose name is on the top of the stack and % executes an internally defined template command templatestartup /starttemplate {begin templatestartup} def %%%%%%%%% % SIMPLE TEXT DUMPER % This default text dumper template is useful for "just dump the text" % applications. The | and \ characters are handled as ordinary text in % this example. The only gonzo commands used are for the carriage return % and the linefeed. A "double escape" | | exits you. % This template is also useful to list your gonzo programs while PRINTING % (rather than executing) all internal gonzo commands. (!!!) % Note that any template MUST have an internal proc named templatestartup % and that your template MUST NOT call gonzofont before run time. 300 dict /dumpasciitext exch def dumpasciitext begin /templatefonts{ /font1 /Helvetica 8 gonzofont % regular text (defer till run time) /font2 /Helvetica-Bold 7 gonzofont % header font (defer till run time) } def /txtwide 230 def % width of column /pm 0 def % no paragraph indents /lmpos 60 def % horizontal left margin /yinc 9.5 def % vertical line spacing /ytop 720 def % top column reference /ybot 50 def % bottom column reference /pagenum 1 def % initial pagenumber /numcolumns 2 def % number of columns /colspace 260 def % spacing between columns % colcheck does all the work in a pagemaker. It is automatically called % at the start of each new printable line. It can make room for figures, etc. /colcheck {ypos ybot lt {column# numcolumns ge {showpage /ypos ytop def /xpos lmpos def /column# 1 def header footer}{/ypos ytop def /xpos xpos colspace add def /column# column# 1 add def} ifelse} if} def % This particular header puts the pagenumber into a message string and % shows it at the right margin of the rightmost column. You can do % left-right and otherwise get as fancy as you care to here ... /header {gsave spacewidth font2 rpagenum (xxxxxx) cvs dup length 5 add string dup 0 (page ) putinterval dup 5 3 index putinterval exch pop lmpos numcolumns 1 sub colspace mul add txtwide add exch ytop yinc 2.5 mul add exch cr grestore /rpagenum rpagenum 1 add def /spacewidth exch def } def /footer {} def % none today /templatestartup { templatefonts font1 /column# 1 def /xpos lmpos def /ypos ytop def/gonzojust false def /rslashok false def /rpagenum pagenum def header footer} def % exitcheck lets you decide how to exit your ASCII text dumper, and can get % VERY sticky. This example uses a double | | as a "double escape". This % trick lets you use this template to print a gonzo LISTING that has all % of the gonzo commands in it (!), but acts improperly on none of them. /asciiexitchar (|) def % exit character reserved if preceeded by altescchar /exitcheck {currentfile read {dup asciiexitchar 0 get eq {pop exitproc} {/chold1 exch def altescapechar chartolinestring chold1 chartolinestring} ifelse}{exitproc} ifelse} def end % dumpasciitext template % Here is a PostScript "textonly" convenience operator that speeds up % text dumping... /textonly {dumpasciitext starttemplate startgonzo} def %%%%%%%%% % SIMPLE PAGE MAKING TEMPLATE % This default gonzo page making template is a useful starting point for % creating your own custom templates. It handles multiple columns and % left-right page numabered headers. All gonzo commands are supported. % Note that there is NO difference between a pagemaker and an emulator. % Everything is programmable, so just rearrange things to suit yourself. % Full document control (for figures etc) is done by extending colcheck. % Note that any template MUST have an internal proc named templatestartup % and that your template MUST NOT call gonzofont before run time. 300 dict /simplepages exch def simplepages begin /templatefonts { % Remember: all fonts MUST defer till run time! /font0 /Times-Bold [54 0 0 54.2 0 -32] gonzofont % drop cap /font1 /Times-Roman 9.75 gonzofont % main text /font2 /Times-Italic 9.75 gonzofont % main italic /font3 /Times-Bold 9.75 gonzofont % main bold /font4 /Times-Roman 9 gonzofont % capnum text /font5 /Times-Italic 9 gonzofont % capnum italic /font6 /Times-Bold 9 gonzofont % capnum bold /font7 /Times-Bold [9.75 0 0 9.5 0 -6] gonzofont % lowered subheader /font= /Symbol 9.75 gonzofont % its greek to me /font- /ZapfDingbats [9 0 0 9 0 4] gonzofont % dingbats } def % values used by gonzo justify ... /colspace 175 def % spacing between columns /cstretch 0.2 def % minimum character kerning /dropcount 4 def % number of lines drop cap drops /lastlinestretch 0.06 def % open last paragraph line slightly /pm 10 def % use paragraph indents /sstretch -0.3 def % minimum space kerning /txtwide 155 def % width of column /ybot 50 def % bottom column reference /yinc 10.5 def % vertical line spacing /ytop 715 def % BASE of top column reference /yinc 10.5 def % vertical line spacing % additional values used by this template /firstpagespecial false def % special treatment for first page? /lmpos 60 def % horizontal left margin /numcolumns 3 def % number of columns /oddpageright true def % are odd numbered pages on the right? /rightpage false def % start with righthand page? /pagenum 1 def % running pagenumber % These macros handle an initial drop cap and low center subheads ... /amacro {(zy0) stringmacro /ypos ypos ypara add def} def % start drop cap /bmacro {(iFy1) stringmacro /ypos ypos ypara add def} def % finish drop cap /cmacro {(znyC7) stringmacro /ypos ypos ypara 2 mul add def} def % centered title /dmacro {(pF1) stringmacro /ypos ypos ypara 2 mul add def} def % normal text after centered title % colcheck does all the work in a pagemaker. It is automatically called % at the start of each new printable line. It can make room for figures, etc. /colcheck {ypos ybot lt {column# numcolumns ge {showpage /ypos ytop def /xpos lmpos def /column# 1 def header footer}{/ypos ytop def /xpos xpos colspace add def /column# column# 1 add def} ifelse} if} def % This particular header picks different formats for left and right pages /header {pagenum cvi 2 mod 0 eq rightpage {not} if {leftheader} {rightheader} ifelse /pagenum pagenum 1 add def} def /headerstripe {gsave xpos ytop 19 add moveto colspace numcolumns 1 sub mul txtwide add 0 rlineto 0.5 setlinewidth stroke} def /leftheader {gsave spacewidth font2 pagenum (xxxxxx) cvs dup length 5 add string dup 0 (page ) putinterval dup 5 3 index putinterval exch pop lmpos exch ytop yinc 2.5 mul add exch cl grestore headerstripe /spacewidth exch def} def /rightheader {gsave spacewidth font2 pagenum (xxxxxx) cvs dup length 5 add string dup 0 (page ) putinterval dup 5 3 index putinterval exch pop lmpos numcolumns 1 sub colspace mul add txtwide add exch ytop 25 add exch cr grestore headerstripe /spacewidth exch def} def /firstpageheader {} def % nothing special today /footer {gsave xpos ybot 6 sub moveto colspace numcolumns 1 sub mul txtwide add 0 rlineto 1.5 setlinewidth stroke} def /templatestartup { templatefonts font1 /column# 1 def /xpos lmpos def /ypos ytop def /gonzojust true def /rslashok true def header footer} def end % simplepages template %%%%%%%%%%%%%%%% end % entire gonzo dictionary %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % END OF GURU'S GONZO JUSTIFY UTILITIES AND TEMPLATES % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% statusdict begin statusdict /setduplexmode known {true setduplexmode} if end systemdict /setstrokeadjust known {true setstrokeadjust} if /mastergray {0.96} def % sets overall light grade shade %%%%%%%%%%%%%%%%% % Here's some needed routines not yet in GUTILITY.PTL or GONZO13A.PTL %............... % roundbox draws a box path with rounded corners and locks you to the % lower lefthand box corner using this format ... % -xpos- -ypos- -yheight- -cornerrad- roundbox /roundbox {gsave /rad exch def /bt exch def /br exch def /bb exch def /bl exch def bl bb translate rad mark br 2 div 0 0 0 0 bt br bt br 0 br 2 div 0] roundpath} def % vrule gives a fixed vertical rule, inputting xpos ystart yend linewidth /vrule {gsave newpath setlinewidth 2 index 4 2 roll moveto exch lineto 0 setgray stroke grestore} def % hrule gives a fixed horizontal rule, inputting ypos xstart xend linewidth /hrule {gsave newpath setlinewidth 1 index 4 2 roll moveto lineto 0 setgray stroke grestore} def % mergestr is a tool useful for page numbers; evenutally it will go % into the nuisance dictionary /mergestr {2 copy length exch length add string dup dup 4 3 roll 4 index length exch putinterval 3 1 roll exch 0 exch putinterval} def % this is a repeat of the GONZO13B callout width proc ... gonzo begin /endtheline {/curwide txtwide roomleft sub def justx cvx exec oktoprint {printline} if} bind def /cw {save /snapc1 exch def /oktoadvance false def /oktoprint false def /linestring linestring2 def /justx (justL) def 3 1 roll /ypos exch def /xpos exch def stringgonzo curwide snapc1 restore} def end gonzo begin % This is the core keystone code routine. It works by taking an average % of the first two and last two string lengths to determine the keystone % slope, increment, and starting width. It then checks the length of % each line and extends the starting width as needed so everything fits. /keyproc {/kadj exch def /msg exch def /yy1 exch def /xx1 exch def mark {msg (\n) search {exch pop exch /msg exch def dup length 0 le {pop} if}{dup length 0 le {pop} if exit} ifelse} loop ] /karray exch def 0 0 karray 0 get cw 0 0 karray 1 get cw add 2 div dup 0 0 karray dup length 1 sub get cw 0 0 karray dup length 2 sub get cw add 2 div sub neg karray length 1 sub div dup /kinc exch def 2 div sub /kstart exch def /txtwide 10000 def 0 0 1 karray length 1 sub {/kpn exch def 0 0 karray kpn get cw kstart kinc kpn mul add sub 2 copy lt {exch} if pop} for kstart add 1.01 mul dup /kstart exch def /txtwide exch def /justifylastline true def 0 1 karray length 1 sub { /posn exch def yy1 xx1 kstart kadj exch posn karray exch get cf /txtwide txtwide kinc add def /xx1 xx1 kinc kadj def /yy1 yy1 yinc sub def} for} def % these are the three keystone routines. Use xpos ypos true (msg strings) % cck, etc. true for keystone; false for ordinary justify. /cck {save /keysnap exch def exch {{2 div sub} keyproc} {cc} ifelse keysnap restore} def % callout centered keystone /clk {save /keysnap exch def exch {{pop} keyproc} {cl} ifelse keysnap restore} def % callout left keystone /crk {save /keysnap exch def exch {{sub} keyproc} {cr} ifelse keysnap restore} def % callout right keystone end % close gonzo dictionary %%%%%% doembeddedproc executes |/name installdoembeddedproc links it /doembeddedproc {mark 50 {stringmode {getstringchar}{currentfile read} ifelse not {exit} if dup dup dup 32 eq exch 13 eq or exch 10 eq or {pop exit} if} repeat counttomark dup string /pstr1 exch def 1 sub -1 0 {pstr1 3 1 roll exch put} for pstr1 exch pop cvx exec} def /installdoembeddedproc {gonzo begin commands (/) 0 get {doembeddedproc} put end} def installdoembeddedproc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% your gonzo code goes here. The usual way of starting it is with %% gonzo begin %% ps.util.1 begin %% printerror %% nuisance begin %% Additional use details appear in the POSTSCRIPT BEGINNER STUFF %% package from SYNERGETICS. % ============== end gonzo utilities ===================== % Gonzo character colorizer /blueon {mark /blue cvx 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /blueoff {mark /lime cvx 0 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton {mark 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tintoff {mark 0 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def %%%%%%%%%%%%%% COMPACT VERSION OF COLORIZER II %%%%%%%%%%%%%%%%%%%%%% /settint {dup /currenttint exch store 5.999 mul dup floor cvi /&cbar exch store dup floor sub /&cwt exch store [ {/setgray [ /dup cvx 0.3 &cwt 0.59 mul add /ge cvx [1 /exch cvx &cwt 0.59 mul 0.30 add /sub cvx 1 &cwt sub 0.59 mul 0.11 add /div cvx /dup cvx 1 &cwt sub /mul cvx &cwt /add cvx /exch cvx ] cvx [ &cwt 0.59 mul 0.3 add /div cvx /dup cvx &cwt /mul cvx 0] cvx /ifelse cvx /setrgbcolor cvx] cvx /def cvx} {/setgray [/dup cvx 0.59 1 &cwt sub 0.3 mul add /ge cvx [1 &cwt sub 0.3 mul 0.59 add /sub cvx &cwt 0.3 mul 0.11 add /div cvx /dup cvx &cwt /mul cvx 1 &cwt sub /add cvx /exch cvx 1 /exch cvx] cvx [1 &cwt sub 0.3 mul 0.59 add /div cvx /dup cvx 1 &cwt sub /mul cvx /exch cvx 0] cvx /ifelse cvx /setrgbcolor cvx] cvx /def cvx} {/setgray [/dup cvx 0.59 &cwt 0.11 mul add /ge cvx [&cwt 0.11 mul 0.59 add /sub cvx 1 &cwt sub 0.11 mul 0.30 add /div cvx /dup cvx 1 &cwt sub /mul cvx &cwt /add cvx 1 /exch cvx] cvx [0 /exch cvx &cwt 0.11 mul 0.59 add /div cvx /dup cvx &cwt /mul cvx] cvx /ifelse cvx /setrgbcolor cvx] cvx /def cvx} {/setgray [/dup cvx 0.59 1 &cwt sub mul 0.11 add /ge cvx [1 &cwt sub 0.59 mul 0.11 add /sub cvx &cwt 0.59 mul 0.30 add /div cvx /dup cvx &cwt /mul cvx 1 &cwt sub /add cvx 1] cvx [0 /exch cvx 1 &cwt sub 0.59 mul 0.11 add /div cvx /dup cvx 1 &cwt sub /mul cvx /exch cvx] cvx /ifelse cvx /setrgbcolor cvx] cvx /def cvx} {/setgray [/dup cvx 0.11 &cwt 0.30 mul add /ge cvx[&cwt 0.30 mul 0.11 add /sub cvx 1 &cwt sub 0.30 mul 0.59 add /div cvx /dup cvx 1 &cwt sub /mul cvx &cwt /add cvx /exch cvx 1] cvx [ &cwt 0.30 mul 0.11 add /div cvx /dup cvx &cwt /mul cvx /exch cvx 0 /exch cvx ] cvx /ifelse cvx /setrgbcolor cvx ] cvx /def cvx} {/setgray [ /dup cvx 0.30 1 &cwt sub 0.11 mul add /ge cvx[ 1 /exch cvx 1 &cwt sub 0.11 mul 0.30 add /sub cvx &cwt 0.11 mul 0.59 add /div cvx /dup cvx &cwt /mul cvx 1 &cwt sub /add cvx ] cvx [ 1 &cwt sub 0.11 mul 0.30 add /div cvx /dup cvx 1 &cwt sub /mul cvx 0 /exch cvx] cvx /ifelse cvx /setrgbcolor cvx ] cvx /def cvx} ] &cbar get exec exec} bind def /beige {0.11 settint} def % examples of convenience operators /aqua {0.52 settint} def /blue {0.67 settint} def /lime {0.44 settint} def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% lime %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% gonzo begin ps.util.1 begin printerror nuisance begin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % starttext % NOTE THAT ALL PS FILENAME STRINGS !!!DEMAND!!! DOUBLE REVERSE SLASHES. % GONZO20A Guru Gonzo PostScript power tools (Interim release) % Includes gonzo justification and layout utilities. % Copyright c 1990, 1996, 2001 by Don Lancaster and Synergetics, Box 809, % Thatcher Arizona, 5552 (928) 428-4073 don@tinaja.com support % via http://www.tinaja.com All commercial rights and all electronic % media rights **FULLY** reserved. Reposting is expressly forbidden. % Many routines removed and cleaned at #58 %%%%%%%%%%% links menu directory %%%%%%%%%%%% % This code locks pdfmark commands out of a PostScript printer. /pdfmark where {pop}{userdict /pdfmark /cleartomark load put} ifelse % /surl "start url" marks the beginning of a text sequence to be urled. % It also paints the text blue... /surl {mark /blue cvx 0.33 /setgray cvx % change text to blue /currentpoint cvx % remember box start /urly /exch cvx /store cvx /urlx /exch cvx /store cvx ] cvx % complete deferred command printlist exch 3 index exch put % stuff into gonzo printlist exch 1 add exch % increment gonzo list count } def % /eurl "end url" unmarks the end of a text sequence and sets up % the pdfmark needed to define the Acrobat web link. /eurl {mark % start deferred proc exch % position url string % /black cvx 0 /setgray cvx % turn blue marker off % maintextcolor /setrgbcolor cvx % reset to main text color??? /aqua cvx /black cvx /makeurl cvx % defer call of url builder ] cvx % complete deferred proc printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch % increment gonzo list count } def % /makeurl generates the pdfmark, receiving a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /urlover 0.2 def % fraction of hot area over bounds /makeurl { /cururlname exch store % save the url string mark % start pdfmark currentfont /ScaleMatrix get 3 get /fsize exch store % guess height /Rect [ urlx fsize urlover mul sub % set box left x urly fsize urlover mul sub % set box left y currentpoint exch fsize urlover mul add exch fsize add ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def % /makeurlx generates the box specific pdfmark, receiving % a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /makeurlx { /cururlnamex exch store % save the url string mark % start pdfmark /Rect [ xpos % set box left x ypos 0.9 sub % set box left y xpos 2.8 add % box right x ypos 0.9 sub 2.8 add % box right y ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def % oversize full page url... ( prevents needing reentry on image substitution ) /sfpurl { /cururlname exch store % save the url string mark % start pdfmark /Rect [-5 0 47 53] /Color [ 1 1 1 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def /maintextcolor {0 0 0 } def % zzzz keep for search marker % dictionary method << % sepcific to combined paper /safford (http://en.wikipedia.org/wiki/Safford,_Arizona) /archaeology (http://en.wikipedia.org/wiki/Archaeology) /prehistoric (http://en.wikipedia.org/wiki/Prehistoric) /gilariver (http://en.wikipedia.org/wiki/Gila_river) /pinalino (http://en.wikipedia.org/wiki/Pinaleno_Mountains) /pleistocene (http://en.wikipedia.org/wiki/Pleistocene) /bajada (http://en.wikipedia.org/wiki/Bajada_(geography)) /artesian (http://en.wikipedia.org/wiki/Artesian_aquifer) /basinandrange (http://en.wikipedia.org/wiki/Basin_and_Range_Province) /mesa (http://en.wikipedia.org/wiki/Mesa) /frenchdrain (http://en.wikipedia.org/wiki/French_drain) /azstateland (http://en.wikipedia.org/wiki/Arizona_State_Land_Department) /cnf (http://en.wikipedia.org/wiki/Coronado_National_Forest) /aquaduct (http://en.wikipedia.org/wiki/Aqueduct_(water_supply)) /engineering (http://en.wikipedia.org/wiki/Engineering) /hohokam (http://en.wikipedia.org/wiki/Hohokam) /donurl (mailto:don@tinaja.com) /emailmurphy (mailto:murph@aznex.net) /lefthand (http://www.tinaja.com/glib/lefthand.pdf) /rob2 (http://www.tinaja.com/images/rob2.jpg) /henry1 (http://www.tinaja.com/images/henry1.jpg) /garmin30 (https://buy.garmin.com/en-US/US/on-the-trail/handhelds/etrex-30/prod87774.html) /hang1 (http://www.tinaja.com/images/hangcan1.jpg) /hscanal (http://mapper.acme.com/?ll=32.75944,-109.81317&z=18&t=S&marker0=32.75893%2C-109.81369%2C8.3%20km%20NE%20of%20Mount%20Graham%20AZ) /don1pap (http://www.tinaja.com/canal/newhang3.pdf) /don2pap (http://www.tinaja.com/canal/newhangshow3.pdf) /neely1pap (http://www.tinaja.com/glib/neely1.pdf) /neely2pap ( ) % not yet available /neely3pap (http://www.tinaja.com/glib/safcanal.pdf) /wesrch (http://www.wesrch.com/) /tin1 (http://www.tinaja.com/tinsamp1.shtml) % entered during gg108 and revision /adot (http://www.azdot.gov/) /cluff (http://www.azgfd.gov/outdoor_recreation/wildlife_area_cluff.shtml) /tramshow.pdf (http://www.tinaja.com/glib/tramshow.pdf) /gilahike.asp (http://www.tinaja.com/gilahike.asp) /usgsaz (http://waterdata.usgs.gov/az/nwis/rt) /bajada (http://www.britannica.com/EBchecked/topic/49396/bajada) /agave (http://en.wikipedia.org/wiki/Agave) /loess (http://en.wikipedia.org/wiki/Loess) /azland (http://www.land.state.az.us/) /aquaduct (http://en.wikipedia.org/wiki/Aqueduct) /quaternary (http://en.wikipedia.org/wiki/Quaternary) /mtgraham (http://en.wikipedia.org/wiki/Mount_Graham) /twinboobs (http://mapper.acme.com/?ll=32.76604,-109.73569&z=18&t=S&marker0=32.69806%2C-109.70694%2Cartesia\%2C%20az) /switch (http://mapper.acme.com/?ll=32.76158,-109.77983&z=16&t=S&marker0=32.69806%2C-109.70694%2Cartesia\%2C%20az) /emailhunt (hunt@brandeis.edu) /emailgulliet (guillet@cua.edu) /emailabbot (dvdabbot@aol.com) /emailbayman (jbayman@hawaii.edu ) /emailpfish (p.fish@u.arizona.edu) /emailsfish (s.fish@u.arizona.edu) /emailkintigh (kinitgh@asu.edu) /emailneely (mailto:neely@mail.utexas.edu) /utexas (http://www.utexas.edu/) /huntstory (http://www.tinaja.com/canal/huntdir1.html) % redirect used because of ASU %20 /americanant (http://www.saa.org/AbouttheSociety/Publications/AmericanAntiquity/tabid/124/Default.aspx) /hohokam (http://en.wikipedia.org/wiki/Hohokam) /neelypap (http://www.tinaja.com/glib/neely1.pdf) /draganfly (http://www.draganfly.com) /safgrid (http://www.amazon.com/exec/obidos/ISBN=0816524289/donlancastersgurA/) /bestgrid (http://www.tinaja.com/images/bestgrid.jpg) /ccc (http://en.wikipedia.org/wiki/Civilian_Conservation_Corps) /lbt (http://mgio.arizona.edu/) /fcx (http://www.fcx.com/operations/USA_Safford.htm) /acmemap (http://mapper.acme.com/) % entered during 122 revision of above %yyyy /safford (http://en.wikipedia.org/wiki/Safford,_Arizona) /gila (http://en.wikipedia.org/wiki/Gila_River) /mesa (http://en.wikipedia.org/wiki/Mesa) /frenchdrain (http://en.wikipedia.org/wiki/French_drain) /impremeable (http://en.wikipedia.org/wiki/Permeability) /waterlevel (http://en.wikipedia.org/wiki/Water_level) /stratigraphy (http://en.wikipedia.org/wiki/Stratigraphy_(archaeology)) /association (http://en.wikipedia.org/wiki/Archaeological_association) /scs (http://en.wikipedia.org/wiki/Natural_Resources_Conservation_Service) /allendam.pdf (http://www.tinaja.com/glib/allendam.pdf) /patina (http://en.wikipedia.org/wiki/Desert_varnish) /caliche (http://en.wikipedia.org/wiki/Caliche) /lichen (http://en.wikipedia.org/wiki/Lichen) /holocene (http://en.wikipedia.org/wiki/Holocene) /precambrian (http://en.wikipedia.org/wiki/Precambrian) /eac (http://www.eac.edu/) /ockham (http://en.wikipedia.org/wiki/Occam's_razor) /mceniry (http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBgQFjAA&url=http%3A//uair.arizona.edu/system/files/usain/download/azu_m9791_t839p_w.pdf&rct=j&q=mceniry%20tunnel%20triumph&ei=ZasrTZnJAoGBlAf855zCAQ&usg=AFQjCNER5yISYTDV-ZUVIvntqfcoKzzntw&sig2=HhK2_76v6unM3__hfOigMQ&cad=rja) /boondoggle (http://en.wikipedia.org/wiki/Boondoggle_(project)) /csi (http://en.wikipedia.org/wiki/Crime_scene_investigator) /agf (http://www.azgfd.gov/) /Hangcan1 (http://www.tinaja.com/images/hangcan1.jpg) % earlier removed % earlier retained /gurgrm01 (http://www.tinaja.com/gurgrm01.shtml) /tinaja (http://www.tinaja.com) /maildon (mailto:don@tinaja.com) >> {mark exch /eurl cvx ] cvx def} forall %%%%%%%%%%%%%%%%%%%% end urls %%%%%%%%%%%%%% %%%%%%%%%%%%%%%% New colorizer defs %%%%%%%%%%%%%%%%%% /boxgrays 0.899 def /grayshade boxgrays def /mastergray boxgrays def /staytint {0.33 setgray} def /staytint1 {0.25 setgray} def /showadgrays true def /red {0 settint} def /Zmacro {staytint /ypos ypos 2 add def 72 300 div setlinewidth xpos ypos moveto txtwide 0 rlineto stroke /ypos ypos -2 add def tintoff} def % hair rule /amacro {(zy0) stringmacro /ypos ypos ypara add def 0.33 setgray } def % start drop cap /bmacro {(iFy1) stringmacro /ypos ypos ypara add def black} def % finish drop cap % Gonzo character colorizer /blueon {mark /blue cvx 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /blueoff {mark /beige cvx 0 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton {mark 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1 {mark 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1p {mark /burple cvx % try for aqua after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1r {mark /red cvx % try for aqua after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1a {mark /aqua cvx % try for aqua after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1b {mark /beige cvx % try for beige after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tintoff {mark 0 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def %%%%%%%%%%%% begin gonzo %%%%%%%%%%%% /guru { gonzo begin ps.util.1 begin printerror nuisance begin} def % guru % activate gonzo utilities 50 50 10 setgrid % create grid % 56 61 showgrid /setpagefonts { /cstretch 0.015 def /sstretch 0.015 def /font0 /StoneSans-Bold 1.6 gonzofont /font1 /StoneSans 0.95 gonzofont /font2 /StoneSans [0.95 0 0.25 0.95 0 0 ] gonzofont /font4 /StoneSans 0.85 gonzofont /font3 /StoneSans-Bold 0.85 gonzofont /font6 /StoneSans-Bold 0.85 gonzofont /font7 /StoneSans-Bold 1.05 gonzofont % subheaders /font8 /StoneSans-Bold [0.65 0 0 0.65 0 0.4] gonzofont /txtwide 36 store /yinc 1.2 store /kern 0.1 store /pm 1.5 store aqua 0.33 setgray font1 black /amacro { mark /aqua cvx 0.33 /setgray cvx ] cvx printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch } def /bmacro { mark /black cvx ] cvx printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch } def /shiftin {xpos /xposhold exch store /xpos xpos 3 add store} def /shiftout {/xpos xposhold store} def /texttop 51 store /textleft 3 store /cmacro {aqua 0.25 setgray (znhL7) stringmacro /xpos xpos 1.7 sub store /ypos ypos .1 sub def } def % left title /dmacro {black (pL1hz) stringmacro /xpos xpos 1.7 add store /ypos ypos .1 add def} def % normal text after centered title /fmacro % try and fake | {mark /gsave cvx /currentpoint cvx /moveto cvx 0.1 /setlinewidth cvx 0 0.65 /rlineto cvx /stroke cvx /grestore cvx ] cvx printlist exch 3 index exch put % stuff into gonzo printlist exch 1 add exch % increment gonzo list count } def } def setpagefonts % -2 50.5 (optional header here \274) cl %% Set document opening conventions. Note DOCVIEW limited. [/CropBox [0 0 520 620] % set the wierd size /PAGES pdfmark [ {Catalog} << /ViewerPreferences << /FitWindow true /CenterWindow true >> /PageLayout /OneColumn % continous /Pagemode /UseNone % no thumbs /View [/XYZ null null 1 ] % force 100% >> /PUT pdfmark %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% page manager /pagenum 1 store /startnewpage { black beige 0.35 setgray 21 -2.5 (|3\320|j|j) ggnum pop () 10 string cvs mergestr % (|j.|j) mergestr pagenum 10 string cvs mergestr (|j|j\320) mergestr cc aqua showpage %% start next page /pagenum pagenum 1 add store 50 50 10 setgrid % create grid setpagefonts font1 textleft texttop } def /su {surl font6} store /to {tinton1 font6} store /tx {tintoff font1} store /tabs [7 20] store %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Burplebox routines /burpwide 29.5 store /burpcom {save /burpx exch store /bht exch store save /burp1 exch store xpos ypos translate -1 .2 mt bht yinc mul .4 add pd burpwide pr bht yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore} store /burpwidew 32 store /burpcomw {save /burpx exch store /bht exch store save /burp1 exch store xpos 1 sub ypos translate 0 .2 mt bht yinc mul .4 add pd burpwidew pr bht yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore} store { /burplebox1 {1.5 burpcom} store /burplebox1.5 {2 burpcom} store /burplebox2 {2.5 burpcom} store /burplebox2.5 {3 burpcom} store /burplebox3 {3.5 burpcom} store /burplebox3.5 {4 burpcom} store /burplebox4 {4.5 burpcom} store /burplebox4.5 {5 burpcom} store /burplebox5 {5.5 burpcom} store /burplebox5.5 {6 burpcom} store /burplebox6 {6.5 burpcom} store /burplebox6.5 {7 burpcom} store /burplebox7 {7.5 burpcom} store /burplebox7.5 {8 burpcom} store /burplebox8 {8.5 burpcom} store /burplebox8.5 {9 burpcom} store /burplebox9 {9.5 burpcom} store /burplebox9.5 {10 burpcom} store /burplebox10 {10.5 burpcom} store /burplebox10.5 {11 burpcom} store /burplebox11 {11.5 burpcom} store /burplebox11.5 {12 burpcom} store /burplebox12 {12.5 burpcom} store /burplebox11w {11.5 burpcomw} store /burplebox12.5 {13 burpcom} store /burplebox13 {13.5 burpcom} store /burplebox13.5 {14 burpcom} store /burplebox14 {14.5 burpcom} store /burplebox14.5 {15 burpcom} store /burplebox15{15.5 burpcom} store /burplebox15.5{16 burpcom} store /burplebox16 {16.5 burpcom} store /burplebox16.5 {17 burpcom} store /burplebox17 {17.5 burpcom} store /burplebox17.5 {18 burpcom} store /burplebox18 {18.5 burpcom} store /burplebox18.5 {19 burpcom} store /burplebox19 {19.5 burpcom} store /burplebox19.5 {20 burpcom} store /burplebox20 {20.5 burpcom} store /burplebox21.5 {22 burpcom} store /burplebox22{22.5 burpcom} store /burplebox22.5 {23 burpcom} store /burplebox23 {23.5 burpcom} store /burplebox23.5 {24 burpcom} store /burplebox24{24.5 burpcom} store /burplebox25{25.5 burpcom} store /burplebox25.5{26 burpcom} store /burplebox27{27.5 burpcom} store /burplebox28 {28.5 burpcom} store /burplebox28.5 {29 burpcom} store /burplebox30 {30.5 burpcom} store /burplebox31 {31.5 burpcom} store /burplebox31.5 {32 burpcom} store /burplebox33.5 {34 burpcom} store /burplebox34 {34.5 burpcom} store /burplebox38 {38.5 burpcom} store /burplebox38.5{39 burpcom} store /burplebox40{40.5 burpcom} store /burplebox40.5{41 burpcom} store /burplebox41.5{42 burpcom} store /burplebox42 {42.5 burpcom} store /burplebox42.5{43 burpcom} store % nearly a full page /burplebox43 {43.5 burpcom} store } pop 1 1 50 {cvi /size exch store % make all the burpleboxes (burplebox) size 20 string cvs mergestr cvn mark size 0.5 add /burpcom cvx ] cvx store (burplebox) size 0.5 add 20 string cvs mergestr cvn mark size 1 add /burpcom cvx ] cvx store } for /burplebox34w{34.5 burpcomw} store /burplebox34.5w{35 burpcomw} store /burplebox38w{38.5 burpcomw} store /burplebox38.5w{39 burpcomw} store /burplebox40w{40.5 burpcomw} store %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % New sequence of auto positioning figures... % combined autopos jpeg conversion and hotlink: /autoimageandlink1 {save /af1 exch store xpos ypos yinc add translate 6.3 -14.1 684 384 .033 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/bargs/cabsvid1.jpg) % url first % (http://www.tinaja.com/images/bargs/ce47u25v.jpg) % url first (C:\\Documents and Settings\\don\\Desktop\\gurugrams\\78_ebayskill_VI\\cabsvid1.jpg) jpegimageprocwithlink af1 restore} store /autoimageandlink2 {save /af2 exch store xpos ypos yinc add translate 18 -11.8 684 487 .022 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/bargs/ce47u25v.jpg) % url first (C:\\Documents and Settings\\don\\Desktop\\gurugrams\\70_ebayskill_iv\\ce47u25v.jpg) jpegimageprocwithlink af2 restore} store /jpegimageprocwithlink { % hoffset voffset hres vres save /snap2 exch def /infilename exch store % grab passed pix file /inurllink exch store % grab link filename /photoscale exch store /vpixels exch store /hpixels exch store translate % adjust position for final figure ??? inurllink setareaurl % autolink sizing /DeviceRGB setcolorspace % pick color model 0 0 translate % set page position hpixels vpixels scale % magnify unit square photoscale dup scale /infile infilename (r) file def % establish input read file /Data {infile /DCTDecode filter} def % define a data source << % start image dicationary /ImageType 1 % always one /Width hpixels % JPEG width in pixels /Height vpixels % JPEG height in pixels /ImageMatrix [hpixels 0 0 vpixels neg 0 vpixels ] /DataSource Data % proc to get filtered JPEG /BitsPerComponent 8 % color resolution /Decode [0 1 0 1 0 1] % per red book 4.10 >> image % call the image operator ypos snap2 restore /ypos exch def } def /setareaurl { % for auto include routine /cururlname exch store mark % start pdfmark /Rect [ 0 0 hpixels photoscale mul vpixels photoscale mul ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def %%%%%%%%%%%%% ordinary tracking figures /autofig1 { /figadvance 23 store save /snap1 exch store xpos 2 add ypos figadvance sub translate figure1 snap1 restore /ypos ypos figadvance sub yinc sub store } store /autofig2 { /figadvance 13 store save /snap2 exch store xpos 2 add ypos figadvance sub translate figure2 snap2 restore /ypos ypos figadvance sub yinc sub store } store /autofig3 { /figadvance 13 store save /snap2 exch store xpos 2 add ypos figadvance sub translate figure3 snap2 restore /ypos ypos figadvance sub yinc sub store } store /autofig4 { /figadvance 13 store save /snap2 exch store xpos 2 add ypos figadvance sub translate figure4 snap2 restore /ypos ypos figadvance sub yinc sub store } store %%%%%%%%%%%%%%% fixed position figures originally here %%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % temp for first marijilda image needs redune with better addresses /font; /Helvetica [0.7 0 0 0.7 0 0.4] gonzofont font1 /font- /Symbol 0.85 gonzofont aqua 0.33 setgray font0 /narrowx {/txtwide txtwide 8.5 sub store} store /widenx {/txtwide txtwide 8.5 add store} store /burpon {mark /burple cvx 0.33 /setgray cvx ] cvx % additional internal gonzo printlist exch 3 index exch put exch 1 add exch} def /burpoff {mark /aqua cvx 0 /setgray cvx ] cvx printlist exch 3 index exch put exch 1 add exch} def /darkenheader {save /headsnap exch store xpos 1 sub ypos 0.2 add translate 0.3 1 1 setrgbcolor 0 0 mt 3.2 pd burpwide pr 3.2 pu closepath fill headsnap restore} store % /274 is ... % sssssssssssssssssssss % start marker /autoimageandlink1 {save /af1 exch store xpos ypos yinc add translate 0 -24.5 1068 712 .033 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/hangcan1.jpg) % url first % (http://www.tinaja.com/images/bargs/ce47u25v.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\gurugrams\\108_hanging_can\\hangcan1.jpg) jpegimageprocwithlink af1 restore} store /autoimageandlink2 {save /af1 exch store xpos ypos yinc add translate 9.2 -25 979 1305 .0185 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/hangcan4.jpg) % url first % (http://www.tinaja.com/images/bargs/ce47u25v.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\gurugrams\\108_hanging_can\\hangcan4.jpg) jpegimageprocwithlink af1 restore} store %%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Figures specific to the hanging canal paper % %%%%%%%%%%%%%%%%%%%%%%%%%%%%% /autofig1 { /figadvance 7 store save /snap1 exch store xpos 2 add ypos figadvance sub translate clickmap1 snap1 restore /ypos ypos figadvance sub yinc sub store } store %%%%%%%%%%%%%%%%%%%%%%%%%%%% /clickmap1 { % map clicking box 0 -3 translate % adjust page position /cstretch 0 store /sstretch 0 store /font0 /StoneSans-Bold 0.9 gonzofont font0 /yinc 1.5 store 6 3 30 6 1 roundbox gsave 0 1 1 setrgbcolor fill grestore 0.1 0.1 0.3 setrgbcolor 15 3.7 (Click for an interactive Google Earth hanging canal map.) cc 15 1.7 (Re-click for more detail on the individual canals.) cc /cururlname (http://www.tinaja.com/canal/mapimage2.kml) store mark % start pdfmark /Rect [ 0 0 30 6] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ 0 0.7 0.7 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators grestore } store %%%%%% shared code for field notes /sharefield {save /share1 exch store xpos ypos translate /blurb exch store /cururlname exch store -1 -5 translate % adjust page position /cstretch 0 store /sstretch 0 store /font0 /StoneSans-Bold 0.9 gonzofont font0 /yinc 1.5 store 6 3 24 3 1 roundbox gsave 0 1 1 setrgbcolor fill grestore 0.1 0.1 0.3 setrgbcolor 12 1.3 blurb cc mark % start pdfmark /Rect [ 0 0 24 3] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ 0 0.7 0.7 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators grestore share1 restore }store /clickpranch { (http://www.tinaja.com/canal/rework/fieldnotes/pranchnotes2.pdf) (Click for the P Ranch area field notes) sharefield } store /clickledford { (http://www.tinaja.com/canal/rework/fieldnotes/ledfordnotes2.pdf) (Click for the Ledford hanging canal field notes) sharefield } store /clickhenry { (http://www.tinaja.com/canal/rework/fieldnotes/henrynotes2.pdf) (Click for the Henry's hanging canal field notes) sharefield } store /clickmarijilda { (http://www.tinaja.com/canal/rework/fieldnotes/marynotes2.pdf) (Click for the Marijilda hanging canal field notes) sharefield } store /clickroper { (http://www.tinaja.com/canal/rework/fieldnotes/ropernotes2.pdf) (Click for the Roper hanging canal field notes) sharefield } store /clicktranquility { (http://www.tinaja.com/canal/rework/fieldnotes/tranqnotes2.pdf) (Click for the Tranquility hanging canal field notes) sharefield } store /clicktwineast { (http://www.tinaja.com/canal/rework/fieldnotes/twineastnotes2.pdf) (Click for the Twin East hanging canal field notes) sharefield } store /clicktwinwest { (http://www.tinaja.com/canal/rework/fieldnotes/twinwestnotes2.pdf) (Click for the Twin West hanging canal field notes) sharefield } store /clickdeadman { (http://www.tinaja.com/canal/rework/fieldnotes/deadmannotes2.pdf) (Click for the Deadman hanging canal field notes) sharefield } store /clicklongview { (http://www.tinaja.com/canal/rework/fieldnotes/longviewnotes2.pdf) (Click for the Longview Area field notes) sharefield } store /clickriggs { (http://www.tinaja.com/canal/rework/fieldnotes/riggsnotes2.pdf) (Click for the Riggs Area field notes) sharefield } store /clickfrye { (http://www.tinaja.com/canal/rework/fieldnotes/fryenotes2.pdf) (Click for the Frye Mesa field notes) sharefield } store /clickrobinson { (http://www.tinaja.com/canal/rework/fieldnotes/robinsonnotes2.pdf) (Click for the Robinson Canal field notes) sharefield } store /clickallen { (http://www.tinaja.com/canal/rework/fieldnotes/allennotes2.pdf) (Click for the Allen Canal field notes) sharefield } store /clickmud { % enteredclickmud (http://www.tinaja.com/canal/rework/fieldnotes/mudnotes2.pdf) (Click for the Mud Springs Canal field notes) sharefield } store /clickjernigan { (http://www.tinaja.com/canal/rework/fieldnotes/jernigannotes2.pdf) (Click for the Jernigan Canal field notes) sharefield } store /clickshingle { (http://www.tinaja.com/canal/rework/fieldnotes/shinglenotes2.pdf) (Click for the Shingle Mill Area field notes) sharefield } store /clicklefthand { (http://www.tinaja.com/canal/rework/fieldnotes/lefthandnotes2.pdf) (Click for the Lefthand Canal field notes) sharefield } store /clickbear { (http://www.tinaja.com/canal/rework/fieldnotes/bearnotes2.pdf) (Click for the Bear Springs Area field notes) sharefield } store /clickbandolier { (http://www.tinaja.com/canal/rework/fieldnotes/bandoliernotes2.pdf) (Click for the Bandolier Canal field notes) sharefield } store %%%%%%%%%%%%%%%%%%%%%%%%%%%% list of study canals /canallist { save /figsnap1 exch store xpos ypos translate 5 -16.0 translate % adjust page position /cstretch 0 store /sstretch 0 store /font0 /StoneSans-Bold 0.85 gonzofont font0 /font1 /StoneSans-Bold 1.3 gonzofont font0 /yinc 1.5 store 0 0 20 16 1 roundbox gsave clip gsave 0 1 1 setrgbcolor fill grestore gsave newpath 0 13 mt 3 pu 30 pr 3 pd closepath 0 0.7 0.7 setrgbcolor fill white 10 14.2 (HANGING CANALS IN THIS STUDY) cc grestore 0.1 0.1 0.3 setrgbcolor /yinc 1.1 store 3 11.5 (P Ranch Ledford|j* Henry's|j* Marijilda|j* Roper|j* Tranquility|j* Twin East|j* Twin West|j* Deadman|j* Longview) cl 11.7 11.5 (Riggs Area Frye Mesa|j* Robinson|j* Allen|j* Mud Springs|j* Jernigan|j* Shingle Mill Lefthand|j* Bear Springs Bandolier) cl grestore grestore figsnap1 restore } store %%%%%%%%%%%%%%%%%%%%%%%%%%%% image stash %%%%%%%%%%%%%%%%%% % images apparently have to be C: local /hang1_image {save /af1 exch store % xpos ypos yinc add translate 3 -0.6 1068 712 .033 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/hangcan1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\hangcan1.jpg) jpegimageprocwithlink af1 restore} store /Hang1 {hang1_image} store /rob1_image {save /af1 exch store % xpos ypos yinc add translate 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/rob1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\gurugrams\\112_hangslide\\rob1.jpg) jpegimageprocwithlink af1 restore} store /Rob1 {rob1_image}store % this needs updated when used /henry1_image {save /af1 exch store % xpos ypos yinc add translate 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/henry1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\henry1.jpg) jpegimageprocwithlink af1 restore} store /Henry1 {henry1_image}store /tranq1_image {save /af1 exch store % xpos ypos yinc add translate 7.5 -0.3 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/tranq1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\tranq1.jpg) jpegimageprocwithlink af1 restore} store /Tranq1 {tranq1_image}store /tranq2_image {save /af1 exch store xpos ypos yinc add translate -2.5 -21.5 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/tranq2.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\tranq2.jpg) jpegimageprocwithlink af1 restore} store /Tranq2 {tranq2_image}store /rinc1_image {save /af1 exch store xpos ypos yinc add translate -2.5 -20.6 translate % adjust page position 8 -0.6 625 528 0.037 % xpos ypos xres yres pixscale (http://mapper.acme.com/?ll=32.76622,-109.73477&z=18&t=S &marker0=32.76580%2C-109.73580%2C2.1%20km%20WxNW%20of%20Cactus%20Flat%20AZ) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\rinc1.jpg) jpegimageprocwithlink af1 restore} store /Rinc1 {rinc1_image}store /rinc2_image {save /af1 exch store xpos ypos yinc add translate -3.5 -21.8 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/rinc2.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\rinc2.jpg) jpegimageprocwithlink af1 restore} store /Rinc2 {rinc2_image}store /threeswitch1_image {save /af1 exch store xpos ypos yinc add translate -2.5 -20.0 translate % adjust page position 8 -0.6 435 327 0.057 % xpos ypos xres yres pixscale (http://mapper.acme.com/?ll=32.76073,-109.78131&z=20&t=S%0A&marker0=32.76073%2C-109.78131%2C6.2%20km%20W%20of%20Cactus%20Flat%20AZ) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\threeswitch.jpg) jpegimageprocwithlink af1 restore} store /Threeswitch1 {threeswitch1_image}store /frye1_image {save /af1 exch store xpos ypos yinc add translate -3.5 -21.8 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/frye1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\frye1.jpg) jpegimageprocwithlink af1 restore} store /Frye1 {frye1_image}store /rob1_image {save /af1 exch store xpos ypos yinc add translate -3.5 -21.5 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/rob1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\rob1.jpg) jpegimageprocwithlink af1 restore} store /Frye1 {frye1_image}store /rob2_image {save /af1 exch store xpos ypos yinc add translate -3.5 -21.8 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/rob2.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\rob2.jpg) jpegimageprocwithlink af1 restore} store /Rob2 {rob2_image}store /rob3_image {save /af1 exch store xpos ypos yinc add translate -3.5 -21.8 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/rob3.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\rob3.jpg) jpegimageprocwithlink af1 restore} store /Rob3 {rob3_image}store /allen0_image {save /af1 exch store xpos ypos yinc add translate -2.5 -20.0 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/allen0.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\allen0.jpg) jpegimageprocwithlink af1 restore} store /Allen0 {allen0_image}store /allen1_image {save /af1 exch store xpos ypos yinc add translate -3.5 -21.2 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/allen1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\allen1.jpg) jpegimageprocwithlink af1 restore} store /Allen1 {allen1_image}store /mud1_image {save /af1 exch store xpos ypos yinc add translate -3.5 -21.2 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/mud1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\mud1.jpg) jpegimageprocwithlink af1 restore} store /Mud1 {mud1_image}store /mud2_image {save /af1 exch store xpos ypos yinc add translate -3.5 -21.2 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/mud2.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\mud2.jpg) jpegimageprocwithlink af1 restore} store /Mud2 {mud2_image}store /troll1_image {save /af1 exch store xpos ypos yinc add translate 4.5 -21.2 translate % adjust page position 0 0 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/troll1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\troll1.jpg) jpegimageprocwithlink af1 restore} store /Troll1 {troll1_image}store /jern1_image {save /af1 exch store xpos ypos yinc add translate -3.5 -20.9 translate % adjust page position 8 -0.6 1000 800 0.027 % xpos ypos xres yres pixscale (http://www.tinaja.com/images/jern1.jpg) % url first (C:\\Documents and Settings\\don 2\\Desktop\\Canal Rework\\images\\jern1.jpg) jpegimageprocwithlink af1 restore} store /Jern1 {jern1_image}store %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /tabs [14] store 20 48.3 0.7 add % 1 sub (The |jBajada |jCanals |jof |jthe |jSafford |jBasin:)cc 20 46.3 0.7 add % 1 sub (Small |jCorporate |jGroup |jCollaboration ) cc 20 44.3 0.7 add % 1 sub (|jin |jSoutheastern |jArizona) cc setpagefonts /font9 /StoneSans-Bold [0.95 0 0.25 0.95 0 0 ] gonzofont font9 black 20 43.2 ( |/surl |9James A. Neely|2|/emailneely P.O. Box 7301 Ruidoso, New Mexico 88355 |h |/surl |9Don Lancaster|2|/maildon P.O. Box 809 Thatcher, Arizona 85552) cc black font2 textleft 34 (|/aqua |/black |a|0T|b|k|1he |/surl |6Safford Basin|1|/safford is known |/surl |6archaeologically|1|/archaeology as an area cultivated extensively in |/surl |6prehistoric|1|/prehistoric times. Both dry and irrigation farming, principally by means of the elaborate canal systems on the floodplain and lower terraces of the |/surl |6Gila River|1|/gilariver , are well documented. Not appreciated, due principally to their recent discovery, are the canal systems south of the river that took flows out of washes heading in the |/su |6Pinaleńo Mountains|1|/pinalino to fields on the tops of |/su |6Pleistocene|1|/pleistocene terraces. |h Presently, 28 canal systems and segments of systems have been identified, some beginning in the |/surl |6bajada|1|/bajada while others branch from drainages originating in the bajada. Because some of these features appear down stream from another, it is likely that they were once joined as a single system. The two longest systems (|jFrye Mesa|j/|jRobinson canal and the Ash Creek|j/|jMud Springs canal|j) are about 9.5 kilometers (|jca. 6 miles|j) in length and course northeastward to relic fields atop the terrace just above and south of the Gila River floodplain. The total length of all of these canals is estimated at about 80 kilometers (|jca. 50 miles|j). Systems were identified by a combination of pedestrian field survey and using the satellite function of |/surl |6Acme Mapper 2.0|1|/acmemap . Additional field verification and |/surl |6hand-held GPS|1|/garmin30 units recorded canal channel coordinates that were transferred to Acme Mapper 2.0 to generating initial location maps. |h These canals have been difficult to date since our study has been based solely on surface survey. We have depended on surface artifact finds and any associated prehistoric sites to provide temporal parameters. While a few of these canals may date as early as ca. A.D. 800, the vast majority appear to have originated after ca. A.D. 1250 and persisted until ca. 1450. As common to many of the Gila River bottomland canals of the area, many of these prehistoric canals were historically refurbished to serve the inhabitants of the greater Safford area, but retain enough integrity to be recognized as having a prehistoric origin. Unfortunately, both the historic and modern constructions and land modifications have negatively affected these systems. ) cl startnewpage (These canal systems are unique from those found in the vicinity of |/su |6Phoenix|1|/huntstory and elsewhere in the Southwest in that |/to they obtained their water from mountain|/tx |/to drainages|/tx fed by runoff, springs, and |/su |6artesian|1|/artesian sources, rather than from rivers. They are also unusual in that they traverse the vertically undulating to severely erratic uplands of |/su |6basin and range|1|/basinandrange topography rather than being restricted to a nearly level riverine floodplain. Some carry their water load from over 1650 m (|jca. 5400 ft.|j) down to just above the floodplain of the Gila River at about 900 m (|jca. 2950 ft.|j). |h In places the canals are of the traditional type \261 narrow, linear excavations into the ground surface that follow the contours of the landscape. In other locations within the same system, |/to they appear as \252perched\272 or \252hanging canals|/tx that traverse sheer sides of |/su |6mesas|1|/mesa \320 with some about 60 meters above the basin floor. The canals often create the illusion of |/surl |6water flowing uphill|1|/hang1 in that the mesa top slope is usually somewhat steeper than the rate of fall of the canal itself. In the latter cases, |/to the hanging segments can end up essentially independent of the|/tx |/to surrounding terrain|/tx , thus reducing energy input resulting from the need to excavate additional canal segments to cut and fill to follow the irregularities of the topography. |h After reaching a mesa top through a long, gentle, and an apparently carefully calculated optimal grade, and then continuing as directly as possible along the characteristically flat but gently sloped ground surface, the canals will typically \252fall off\272 the far end of the mesa in steep but apparently highly controlled and nondestructive cascades descending in near vertical |/su |6French Drain|1|/frenchdrain -like constructs. |h |/surl |6Canal cross-sections|1|/rob2 vary from 0.30 to one meter, with |/surl |6atypical examples|1|/henry1 up to two meters in width, and 20 to 40 centimeters in depth. Their use seems to be primarily long distance water delivery to fields, but the canals also apparently supplied water to small habitation sites and complexes. When assisted by historic rebuilds, several reaches of the canals still flow to this day. Portions of most of the systems remain largely pristine, and many are currently filled with fine-grained sediments. These systems are located mostly on |/surl |6Arizona State|1|/azstateland and on |/surl |6Coronado|/cnf |/su |6 National Forest|1|/cnf lands that remain largely undeveloped. While often of difficult access, major canal portions are usually easily traced. There are few access roads and fewer mesa top trails. |h A number of unusual constructions were incorporated into some of these canal systems; two examples are: an |/surl |6aqueduct|1|/aquaduct , about one and a half meters in height and 100 meters long, was constructed to bridge a “saddle” in the topography associated with prehistoric segment of the Lebanon Canal. At a point where the primary Frye Mesa Canal is situated near the top edge of the mesa, |/su a branching|/hscanal |/surl \252counterflow\272 canal|1|/hscanal was excavated down the mesa slope at an acute angle apparently to irrigate fields lying below and behind the point of branching. |h Several canal systems illustrate elaborate methods of purposeful switching of the water routes between major delivery drainages. In sum, these systems appear to ) cl startnewpage (represent a major understanding and a very careful exploitation of both hydraulic fundamentals as well as extreme energy and use efficiency. |h |/su |6Engineering|1|/engineering can be defined as a sense of the fitness of things. Aptly meeting all these criteria, the Safford Basin bajada canal systems represent a sophisticated innovation that is superbly energy optimal and a brilliant engineering solution for reliable water transport and delivery over the basin and range topography of the area. They are a phenomenal adaptation to an arid environment to irrigate their agricultural fields distant from a once apparently abundant water source. |h The discovery of these canals and recent survey in the Safford Basin suggest that the basin was a prehistoric population center and a major supplier of cultivated crops. Surveys in Lefthand Canyon (|jnear the west boundary|j) and in Marijilda Canyon (|jnear the east boundary|j) recorded a rather heavy population that was concentrated along the canals, but the sites are nearly all small and scattered. |h Survey along many of the other canals recorded only a few smaller sites. These findings provide evidence in the form of agricultural intensification and settlement that points to a socio-political organization based on the collaboration and the collective action of small coroporate groups rather than a more complex social stratification and socio-political structure. |h These findings parallel those reported by |/surl |6Hunt et. al|/huntstory |/to (2005)|1|/tx in their |/surl |6American|/americanant |/surl Antiquity|1|/americanant article on the |/surl |6Hohokam|1|/hohokam area. As a Hohokam presence has been noted for the Safford basin, we migh suggest that Hohokam migrants may have at least in part engineered the sophisticated canal constructions. ) cl startnewpage ( |/to Suggested Reading:|/tx |h |/surl |6Lancaster, Don|1|/maildon |/to 2013|/tx |/surl |6Prehistoric Hanging Canals of the Safford Basin (|jUpdate III|j)|1|/don1pap . Published in |/su |6Wesrch|1|/wesrch and at |/su |6http://www.tinaja.com/tinsamp1.shtml|1|/tin1 . |h |/surl |6Lancaster, Don|1|/maildon |/to 2013|/tx |6|/surl A Prehistoric Hanging Canal Lecture|1|/don2pap . Published in |/su |6Wesrch|1|/wesrch and at |/su |6http://www.tinaja.com/tinsamp1.shtml|1|/tin1 .. |h |/surl |6Neely, James A.|1|/emailneely |/to 2013|/tx |6|/surl Prehistoric Agricultural Strategies in the Safford Basin|1|/neely1pap , Southeastern Arizona. In “Between Mimbres and Hohokam: Exploring the Archaeology and History of Southeastern Arizona and Southwestern New Mexico,” edited by H.D. Wallace. Anthropological Papers No. 51, Archaeology Southwest. Tucson. |h |/surl |6Neely, James A.|1|/emailneely |/to 2005|/tx |/surl |6Prehistoric Agricultural and Settlement Systems in Lefthand Canyon, |/lefthand |/surl |6Safford Valley, Southeastern Arizona|1|/lefthand . In Inscriptions: Papers in Honor of Richard and Nathalie Woodbury, edited by R. N. Wiseman, T. O’Laughlin, and C. T. Snow, pp. 145-169. Papers of the Archaeological Society of New Mexico 31. Albuquerque. |h |/surl |6Neely, James A.|1|/emailneely and |/surl |6Murply, Everett J|/emailmurphy . |/to 2008|/tx |6|/surl Prehistoric Gila River Canals of the Safford Basin|1|/neely3pap , Southeastern Arizona: An Initial Consideration. In Crossroads of the Southwest: Culture, Identity, and Migration in Arizona's Safford Basin (Proceedings of the AAC Fall 2005 Meeting), edited by David E. Purcell, pp. 61-101. Cambridge Scholars Publishing. Newcastle, UK. |h ================================================================= |h |/surl |6Hunt, R.C.|1|/emailhunt , |/surl |6D. Gulliet|1|/emailgulliet , |/surl |6D. Abbot|1|/emailabbot , |/surl |6J. Bayman|1|/emailbayman , |/surl |6P. Fish|1|/emailpfish , |/surl |6S. Fish|/emailsfish , |/surl |6K. Kintigh|1|/emailkintigh , |/surl |6J. Neely|1|/emailneely |/to 2005|/tx |/surl |6Plausible Ethnographic Analogies for the Social Organization of Hohokam|/huntstory |/surl Canal Irrigation|1|/huntstory , American Antiquity 70 (3): 433-456. ) cl startnewpage (http://www.tinaja.com/canal/safcan1.jpg) sfpurl % full page url ( ( insert safcan1.jpg as watermark after Distilling ) ( Or substitute safcan1.pdf as page ) |/to Map of Pinolino Mountain stream fed hanging canals under present study. ) cl startnewpage (http://www.tinaja.com/canal/mary2.jpg) sfpurl % full page url ( ( insert mary2.jpg as watermark after Distilling ) ( Or substitute mary2.pdf as page ) |/to One of the more spectacular hanging canal reaches. ) cl startnewpage (http://www.tinaja.com/canal/hangcan1.jpg) sfpurl % full page url ( ( insert rob2.jpg as watermark after Distilling ) ( Or substitute rob2.pdf as page ) |/to Hanging canal cross sections often show a "water flows uphill" illusion. ) cl startnewpage % EOF % EOF