%! % Name of file: Tech Musings 131 Optical PSD rangefinding and ac power % 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 % .... systemdict /setstrokeadjust known {true setstrokeadjust} if % 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 grayshade 1 ne {0.33}{0} ifelse setgray 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 {staytint1 (znyC7) stringmacro /ypos ypos ypara 2 mul add def} def % centered title /dmacro {tintoff(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. %%%%%%%%%%%%%%%%%% COLORIZER MOD %%%%%%%%%%%%% %%%%%%%%%%%%%%%% % COLORIZING BLACK AND WHITE POSTSCRIPT MODULE % ===================================== /tintmat [ {dup 0.11 ge {0.11 sub 0.89 div dup 1 setrgbcolor} % 0 blue {0.11 div 0 exch 0 exch setrgbcolor} ifelse} {dup 0.3 ge {0.3 sub 0.7 div 1 exch dup setrgbcolor} % 1 red {0.3 div 0 0 setrgbcolor} ifelse} {dup 0.59 ge {0.59 sub 0.41 div dup 1 exch setrgbcolor} % 2 green {0.59 div 0 exch 0 setrgbcolor} ifelse} {dup 0.7 ge {0.7 sub 0.3 div 1 1 setrgbcolor} % 3 turquoise {0.7 div 0 exch dup setrgbcolor} ifelse} {dup 0.41 ge {0.41 sub 0.59 div 1 exch 1 setrgbcolor} % 4 magenta {0.41 div dup 0 exch setrgbcolor} ifelse} {dup 0.89 ge {0.89 sub 0.11 div 1 exch 1 exch setrgbcolor} % 5 yellow {0.89 div dup 0 setrgbcolor} ifelse} {dup 0.842 ge {dup .7 mul .59 sub .11 div 1 exch setrgbcolor} % 6 lime {0.89 div dup 1.1233 div exch 1.1233 mul 0 setrgbcolor} ifelse} {dup 0.731 ge {1 exch dup .41 mul .30 sub .11 div setrgbcolor} % 7 beige {0.856 div dup 1.155 mul exch 1.55 div 0 setrgbcolor} ifelse} ] def /tint 7 def /setgray {tintmat tint get cvx exec} bind 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.10 settint} def % examples of convenience operators /aqua {0.52 settint} def /blue {0.67 settint} def /lime {0.44 settint} def /red {0 settint} def /green {0.33 settint} def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % aqua % normal for blat %! % X E % Z % MUSE.116.Y gonzo begin ps.util.1 begin printerror nuisance begin longjob 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % HACK III TEMPLATE % This default gonzo page making template is a useful starting point for % creating your own custom templates. It allows multiple page documents % with full picture insertions and total text control. % Note that any template MUST have an internal proc named templatestartup % and that your template MUST NOT call gonzofont before run time. 300 dict /muse3 exch def muse3 begin /templatefonts { % Remember: all fonts MUST defer till run time! /font0 /Times-Bold [54 0 0 54.1 0 -32] gonzofont /font1 /Times-Roman [9.75 0 0 9.75 0 0] gonzofont /font2 /Times-Italic [9.75 0 0 9.75 0 0] gonzofont /font3 /Times-Bold [9.75 0 0 9.77 0 -6] gonzofont /font4 /Times-Roman [9 0 0 9 0 0] gonzofont /font5 /Times-Italic [9 0 0 9 0 0] gonzofont /font6 /Times-Bold [9 0 0 9 0 0] gonzofont /font7 /Helvetica [9 0 0 9 0 0] gonzofont /font8 /Helvetica [8 0 0 8 0 0] gonzofont /font9 /Helvetica-Bold [9 0 0 9.1 0 4] gonzofont /font- /ZapfDingbats [9 0 0 9 0 0] gonzofont /font= /Symbol [9 0 0 9.1 0 -0.5] gonzofont } def % normallisting is used by the GURU figures for long text ... /normallisting { /txtwide bw 10 sub def /ybot -99999 def /font0 /Helvetica-Bold 12 gonzofont /font1 /Helvetica 8.5 gonzofont /font2 /Helvetica-Oblique 8.5 gonzofont /font3 /Helvetica-Bold 8.5 gonzofont /font4 /Courier 8.5 gonzofont /ypos bt 20 sub def /xpos bl 20 add def /yinc 10 def /pmnorm 60 def /amacro {(Lhy) stringmacro} def /bmacro {(1py) stringmacro} def /cmacro {(3z) stringmacro} def} def % denselisting is used by GURU figures for tighter text /denselisting{/bc br bl sub 2 div bl add def /txtwide bw 10 sub def /ybot -99999 def /font0 /Helvetica-Bold 10 gonzofont /font1 /Helvetica 7 gonzofont /font2 /Helvetica-Oblique 7 gonzofont /font3 /Helvetica-Bold 7 gonzofont /font4 /Courier 7 gonzofont /ypos bt 10 sub def /xpos bl 6 add def /yinc 8 def /amacro {(hy) stringmacro} def /emacro {/yparendadj yinc 2 div def} def} def % values used by gonzo justify ... /cstretch 0.1 def % minimum character kerning /sstretch -0.2 def % minimum space 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 /yinc 10.5 def % line spacing /ypara 0 def % extra interparagraph spacing /pagenum 1 def % These macros handle an initial drop cap and low center subheads ... /amacro {(zyL0) stringmacro /ypos ypos ypara add def} def % start drop cap /bmacro {(iFy1) stringmacro /ypos ypos ypara add def} def % finish drop cap /cmacro {staytint1 (znyC3) stringmacro /ypos ypos ypara 2 mul add def} def % centered title /dmacro {black (pF1) stringmacro /ypos ypos ypara 2 mul add def} def % normal text after centered title % reference values for internal doc control that become calculated % array values. Note that it is best to work in fixed yinc heights % to prevent alignment problems under figures. Note that it is nearly % always best to AVOID FIXED VALUES IN DOCMATRIX. /txw 155 def % width of normal text columns /cmb 60 def % column bottom position /cmt cmb 60 yinc mul add def % page is 60 normal text lines high /cml 60 def % first column left margin /cms 170 def % spacing of normal columns /cm# 3 def % number of normal columns /cm1 cml def % c1 starts at left margin /cm2 cml cms add def % c2 in middle /cm3 cml cms 2 mul add def % c3 to right /cmw cms txw sub def % white space between columns /hdw cms 2 mul txw add def % normal header/footer width /hdc cm1 hdw 2 div add def % normal header/footer center /hdr cm1 hdw add def % normal header/footer right /hdl cm1 def % normal header left /fdp 14 def % amount of footer drop below cml /bh1 yinc 6 mul def % 8 vlines reserved for title & blurb /stdfigrad 0.1 def % radius of standard figure box /1colwide txw def % width of single column figure /2colwide txw cms add def % width of double column figure /3colwide txw cms 2 mul add def % width of triple column figure /f1h yinc 34 mul def % height of figure one /f2h yinc 24 mul def % height of figure two /f3h yinc 36.5 mul def % height of figure three /f4h yinc 34 mul def % height of figure four /f5h yinc 25 mul def % height of figure five /f6h yinc 35 mul def % height of figure six /s1h yinc 29 mul def % height of custom sidebar /s2h yinc 47 mul def % height of n/n sidebar /a1h yinc 66 mul def % height of synergetics ad /h1h yinc 14 mul def % height of optional help box /tfa {yinc 1.5 mul add} def % upper figure position adjust % warning: second true must stay that way; must use blank namek /fig1 {cm2 cmb 3 sub 2colwide f1h true % 2 sub adjust for gray top true /f1name /figure1 stdmusefig} def % link /fig2 {cm1 cmt f2h sub yinc add 3 add 2colwide f2h true true /f2name /figure2 stdmusefig} def % link /fig3 {cm1 cmb 1 add 2colwide f3h true true /f3name /figure3 stdmusefig} def % link /fig4 {cm2 cmt f4h sub yinc add 3 add 2colwide f4h true true /f4name /figure4 stdmusefig} def % link /fig5 {cm1 cmt f5h sub yinc add 3 add 1colwide f5h true true /f5name /figure5 graymusefig} def % link /fig6 {cm2 cmb 3 sub yinc add 4 add 2colwide f6h true true /f5name /figure6 stdmusefig} def % link /ad1 {cm3 cmb 1colwide f5h false true /ad1name /ad1copy stdmusefig} def % link /side1 {cm1 cmt s1h sub yinc add 3colwide s1h true true /s1name /sidebar1 grayfig2} def % link /side1 {cm2 cmt s1h sub yinc add % special for url 2colwide s1h true true /s1name /sidebar1 grayfig2} def % link /side2 {cm1 cmt s2h sub yinc add 2colwide s2h true true /s2name /sidebar2 grayfig2} def % link /help {cm2 % cmt 16 yinc mul sub cmb 4 sub 1colwide h1h true false /helpname /hackhelp graymusefig} def % this is a "standard" figure border for HACK3. It has rounded edges, % a bottom single line title, and links to the actual figure art... /narrowfig 0 def % narrowing option /stdmusefig { /jsave justx 4 get def save /stdsnap exch def grayfig {0 3 translate} if % shift /colcheck {} def /figproc exch def cvx /figname exch def /showtitle exch def /showborder exch def /figheight exch def narrowfig sub /figwidth exch def -10 add translate /linestring linestring2 def /pmrun 0 def /txtwide figwidth 2 sub def /font1 /Helvetica 9 gonzofont /yinc 10 def /oktoprint false def /oktoadvance true def /xpos 0 def /ypos 0 def figname stringgonzo /titadjust ypos neg def /oktoprint true def /bw figwidth def /bt figheight def /bl 0 def /bb 0 def /bc figwidth 2 div def /xpos 20 def /ypos bt 20 sub def showtitle {0 narrowfig 2 div add titadjust figname cf} if showtitle not {/titadjust 0 def} if % no suppression if no title showborder {1 narrowfig 2 div add titadjust 12 add figwidth 2 sub figheight titadjust sub 10 sub stdfigrad roundbox 0.5 setlinewidth grayfig {gsave % LaserWriterG {0.90}{0.95}ifelse setgray grayshade setgray fill grestore [2.5 0 1.5 1] superstroke } {stroke} ifelse} if /linestring linestring2 def % needed to run interference /cstretch 0.01 def /sstretch 0.01 def /pmrun 0 def /colcheck {} def 3 1 roll translate dup scale % adjust figure position mark figproc cvx exec cleartomark stdsnap restore justx 4 jsave put } def /grayfig false def % show stdmusefig with gray background default /graymusefig {/grayfig true def stdmusefig /grayfig false def} def %%%% % has a title box /grayfig2rad 0.01 def /showboxgrays true def /grayfig2 { /jsave justx 4 get def save /stdsnap exch def /colcheck {} def /figproc exch def cvx /figname exch def /showtitle exch def /showborder exch def /figheight exch def /figwidth exch def translate showborder {1 2 figwidth 2 sub figheight 5 sub grayfig2rad roundbox 0.4 figheight 28 sub moveto figwidth 1.8 sub 0 rlineto gsave showboxgrays {mastergray setgray}{1 setgray} ifelse fill grestore gsave newpath 0 figheight 5 sub moveto figwidth 1.8 sub 0 rlineto 0 -23 rlineto figwidth 1.8 sub neg 0 rlineto closepath grayshade dup 1 ne {0.15 sub pop 0.33} if setgray fill grestore [2 0 1 1] superstroke } if /font7 /Helvetica-Bold 9 1 add gonzofont showtitle {black white % 0.25 setgray figwidth 2 div figheight 20 sub 0.5 sub font7 figname cc black} if /bw figwidth def /bt figheight def /bl 0 def /bb 0 def /bc figwidth 2 div def /xpos 20 def /ypos bt 20 sub def /cstretch 0 def /sstretch 0 def /lastlinestretch 0 def /pmrun 0 def /ypara 0 def /linestring linestring2 def 3 1 roll translate dup dup /csf exch def scale mark figproc cvx exec cleartomark stdsnap restore justx 4 jsave put } def %%% % Here is the master document control matrix. It is manual in this example % Note that the result of internal calcs are ORDINARY NUMBERS. Note also % that you make room for figures by adding or subtracting only where and % as needed. /docmatrix [ [ { } { } {/narrowfig 0 store } ] % initial document files [ [{titleblock} % xpos ypos scale name {rightfooter} {/narrowfig 50 store 0 0 0.9 fig1} ] % page one figures and control [ cm1 cmt bh1 sub cmb {txw}] % column1 xpos ypos ylimit txtwide [ cm2 cmt bh1 sub cmb f1h add {txw} ] % column2 [ cm3 cmt bh1 sub cmb f1h add {txw} ] % column3 ] [ [{leftfooter} {leftheader} {/narrowfig 0 store} {0 0 0.9 fig2} % {/narrowfig 0 store} {0 0 0.9 fig3} ] % page two figures and control % [ cm1 cmt f2h sub cmb f3h add {txw}] % column1 xpos ypos ylimit txtwide % [ cm2 cmt f2h sub cmb f3h add {txw}] % column2 xpos ypos ylimit txtwide [ cm3 cmt cmb {txw} ] % column3 xpos ypos ylimit txtwide ] [ [ {rightfooter} {rightheader} % {/narrowfig 80 store} % {0 0 0.9 fig3} {/narrowfig 0 store} { 0 0 0.9 fig4} % {/narrowfig 0 store} % {12 -20 0.9 fig5} ] % page three figures and control [ cm1 cmt cmb {txw}] % column1 ship [ cm2 cmt f4h sub cmb {txw}] % [ cm3 cmt f4h sub cmb {txw} ] % ] [ [{leftfooter} {leftheader} {/namestretch 2.5 def} {15 0 0.85 side1} {0 -6 1 help} % temp help box ] % page four figures and control % [ cm1 cmt s1h sub cmb {txw}] % special yinc no caption [ cm1 cmt cmb {txw}] % for two wide url only [ cm2 cmt s1h sub cmb h1h add {txw}] [ cm3 cmt s1h sub cmb {txw}] ] [ [{rightfooter} {rightheader} {0 31 21 add 1 ad1} {/namestretch 2 def} {15 0 0.85 side2} ] % page five figures and control [ cm1 cmt s2h sub cmb txw] % column1 xpos ypos ylimit txtwide [ cm2 cmt s2h sub cmb txw] % column2 xpos ypos ylimit txtwide % [ cm3 cmt cmb txw] % column3 xpos ypos ylimit txtwide ] /adj {30 yinc mul add } def [ [{leftfooter} {leftheader} % {-5 -35 1 fig4} % {/namestretch 0 def} % {14 0 0.85 side2} % {18 -24 0.9 fig4} % {4 -17 0.9 fig5} ] % page six figures and control [ cm1 cmt cmb adj txw] % column1 xpos ypos ylimit txtwide [ cm2 cmt cmb adj txw] [ cm3 cmt cmb txw] ] % change [ {quit} ] to [ {exitproc} ] [[{}] [cm1 cmt cmb txw]] % possible blank page ? [[{}] [cm2 cmt cmb txw]] % possible blank page ? [[{}] [cm3 cmt cmb txw]] % possible blank page ? % leave [ {quit} ] at end of page setup file [ {exitproc} ] % final document wrapup % NOTE: will not execute with short copy! ] def /nextpage { showpage adjustpage /pagenum pagenum 1 add def docpage numpages lt { /docpage docpage 1 add def docmatrix docpage get /curpage exch def curpage length 1 sub /numpgcol exch def curpage 0 get {cvx exec} forall /curcol 1 def nextcol} {docmatrix curpage 1 add get {cvx exec} forall } ifelse } def % modified nextcol allows pages without text and deferred xpos calcs. /nextcol { numpgcol 0 gt { curpage curcol get aload pop exec /txtwide exch def exec /ylimit exch def exec /ypos exch def exec /xpos exch def /curcol curcol 1 add def}{ nextpage} ifelse} def /colcheck { ypos ylimit 1 sub le { curcol numpgcol gt {nextpage} {nextcol} ifelse} if } def /templatestartup { templatefonts font1 /gonzojust true def /rslashok true def docmatrix length /numpages exch def /docpage 1 def docmatrix 0 get {cvx exec} forall % do initial document files docmatrix docpage get /curpage exch def curpage length 1 sub /numpgcol exch def curpage 0 get {cvx exec} forall % do initial page files /curcol 1 def nextcol } def % titleblock, headers and footers /titleblock {save /blurbsnap exch def /colcheck {} def /cstretch 0.2 def sstretch 1 def cml cmt bh1 sub 15 add translate /blurbboxwide 180 def /blurbboxhigh 80 def 1 setlinecap bestgray 3 23 mt hdw 15 sub blurbboxwide sub 3 sub 23 lineto hdw 3 sub 23 moveto -10 0 rlineto [6 0.3 4.5 .85] superstroke % changed to brown hdw blurbboxwide sub 15 sub 0 blurbboxwide blurbboxhigh 5 roundbox gsave grayshade setgray fill grestore % temp expt [4 0.3 2.5 .85] superstroke 0.85 setgray 4.5 setlinewidth -5 23 mt 3 r blurbboxwide 1 add 23 mt 3 r stroke grestore 0.3 setgray /font0 /Palatino-Bold 30 gonzofont /font1 /Palatino-Bold 10 gonzofont 0.2 setgray /font2 /Palatino-Bold 12 gonzofont font2 4 62 7 add author cl font0 3 34 4 add titlename cl font2 4 7 titledate cl 0.15 setgray /yinc 12 def hdw font1 105 sub 60 dokeystone titleblurb cck blurbsnap restore} def /leftheader {save /blurbsnap exch def /colcheck {} def cml cmt 16 add translate gsave mastergray setgray 0 8 mt 16 setlinewidth hdw r grestore % color fill? 0 0 hdw 1.2 hrule 0 16 hdw 0.5 hrule /cstretch 0.2 def /sstretch 1 def /font2 /Palatino-Bold 11 gonzofont 0 4.5 leftheading cl blurbsnap restore} def /rightheader {save /blurbsnap exch def /colcheck {} def cml cmt 16 add translate gsave mastergray setgray 0 8 mt 16 setlinewidth hdw r grestore % color fill? 0 0 hdw 1.2 hrule 0 16 hdw 0.5 hrule /cstretch 0.2 def /sstretch 1 def /font2 /Palatino-Bold 11 gonzofont hdw 4.5 rightheading cr blurbsnap restore} def /leftfooter { save /blurbsnap exch def /colcheck {} def cml cmb 13 sub translate /txtwide 1000 store /font3 /Helvetica 4.5 gonzofont font3 hdw -6 (Copyright c 1998 by Don Lancaster and Synergetics (520) 428-4073 www.tinaja.com \ All commercial rights and all electronic media rights fully reserved. Reposting expressly forbidden.) cr 0 0 hdw 0.8 hrule gsave 25 0 translate -18 -7 36 14 2 roundbox gsave mastergray setgray fill grestore 0.5 setlinewidth stroke /font2 /Palatino-Bold 11 gonzofont /cstretch 0.4 def 16 2 add 0.2 setgray 3.5 columnum ( ) cvs (.) mergestr colpagenum ( ) cvs mergestr cc blurbsnap restore /colpagenum colpagenum 1 add def } def % adjusted for 100 - was -16 -7 32 14 /rightfooter {save /blurbsnap exch def /colcheck {} def cml cmb 13 sub translate /txtwide 1000 store /font3 /Helvetica 4.5 gonzofont font3 0 -6 (Copyright c 1998 by Don Lancaster and Synergetics (520) 428-4073 www.tinaja.com \ All commercial rights and all electronic media rights fully reserved. Reposting expressly forbidden.) cl 0 0 hdw 0.8 hrule gsave hdw 25 sub 0 translate -18 -7 36 14 2 roundbox gsave mastergray setgray fill grestore 0.5 setlinewidth stroke /cstretch 0.4 def /font2 /Palatino-Bold 11 gonzofont 16 2 add 3.5 0.2 setgray columnum ( ) cvs (.) mergestr colpagenum ( ) cvs mergestr cc blurbsnap restore /colpagenum colpagenum 1 add def} def end % guru3 template %% TEMP BYPASSES %%% /adjustpage {} def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % INCLUDED FILES AND PROCS /dokeystone false def /titleblurb (Position sensitive detectors Error |jcorrecting |jcode |jbooks Optical |jrangefinding |jsecrets Noisy ac power mesurements New |jstereolithography |jresins ) def /author (Don Lancaster's) def /titlename (T|k|kech M|k|kusings) def /titledate (December, 1998 |j) def /leftheading ( Tech Musings) def /rightheading titledate def /columnum 131 def /colpagenum 1 def %%%%%%%%%%%%% COMMON HEADER %%%%%%%%%%%%%%%%% % graybox utilities /grayfill {gsave bl bb translate /doublestroke true def 0 0 moveto 0 bh lineto bw bh lineto bw 0 lineto closepath mastergray setgray fill grestore} def /whitebox {gsave /wh exch def /ww exch def translate 0 0 mt 0 wh rlineto ww 0 rlineto 0 wh neg rlineto closepath gsave white fill grestore line1 stroke} def % keeps state! /doublestroke true def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % /grayshade 0.92 def /grayshade1 {grayshade} def /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse } {pop} ifelse setgray } def /figure1 { % name of textfile: muse.fig.131.1 parallax theory % ............................ save /snap1 exch def systemdict /setstrokeadjust known {true setstrokeadjust} if electronics begin 45 15 10 setgrid % 33 36 showgrid % /grayshade 0.92 def /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse } {pop} ifelse setgray } def % /setgray1 {setgray} def % bypass /green {0.33 settint} def /red {0 settint} def /beige {0.10 settint} def /cstretch 0.02 def /sstretch 0.05 def /kern 0.1 def /yinc 1.1 def /font0 /Helvetica-Bold 1.2 gonzofont /font1 /Helvetica 0.7 gonzofont /font4 /Helvetica 0.6 gonzofont /font3 /Helvetica-Bold 0.70 gonzofont /font2 /Helvetica-Oblique 0.75 gonzofont /font5 /Helvetica-Bold [2 0 0 1.4 0 0] gonzofont /font6 /Helvetica [2 0 0 1.4 0 0] gonzofont /font7 /Helvetica [0.6 0 0 0.6 0 -.3] gonzofont /font8 /Symbol 0.9 gonzofont /font6 /Symbol 0.75 gonzofont /kern 0.1 def /font7 /Helvetica-Bold 1.7 gonzofont /yinc 1.0 def /txtwide 26 def /tabs [-1.5] def /font0 /Helvetica-Bold [1.2 0 0 1 0 0] gonzofont /parallax {gsave translate line1 0 0 mt 4 pr 9 pu closepath gsave grayshade 0.15 sub setgray1 fill grestore 0.33 setgray1 line2 stroke line1 stroke gsave 4 9 translate 2 dup scale red 0.33 setgray1 0 0 mt dot grestore red 0.33 setgray1 0 setlinecap 0.3 setlinewidth 0 0 mt 4 r font1 beige 0.33 setgray1 /yinc 0.8 def black 2 -1.3 (baseline) cc 6.2 5 (first view) cc -0.8 5 (second view) cc 0.8 0.3 (|6q) cc 4 10.7 (sensed\nobject) cc /font7 /Helvetica-Bold 1 gonzofont /font6 /Symbol 1.2 gonzofont font7 aqua 0.33 setgray1 6.5 1.85 (distance = baseline|j|j|jx|j|j|jtan|j|6q) cl grestore} def %%%%% /ledd { gsave translate 90 rotate 1 setlinecap 0.8 setlinewidth red 0.33 setgray1 -0.3 0 mt 0.5 l 0 setlinecap 0 0 mt 0.4 l 0.3 setlinewidth 0 -0.6 mt 1.2 u black line1 % 0 0.3 mt 0.5 r 0.7 u 2 r % 0 -0.3 mt 0.5 r 0.7 d 0.5 r 1.5 u 1.5 r grestore}def /psd {gsave translate gsave 10 10.1 translate -45 rotate [-2 0 30 % lens 2 0 -30 2 0 -150 -2 0 150] curvetrace gsave grayshade 0.15 sub setgray1 grayshade 1 ne {0.9 0.9 0.9 setrgbcolor}{white} ifelse fill grestore 0.33 setgray1 black line2 stroke grestore gsave 12.5 12.5 translate -45 rotate % psd itself black line1 -2 0.4 mt 0.5 l 2 u circ1 2 0.4 mt 0.5 r 2 u circ1 0 0.8 mt 1.6 u uground -2 0 mt 4 pr 0.8 pu 4 pl closepath gsave beige grayshade 0.15 sub setgray1 fill grestore 0.33 setgray1 line2 stroke 0.2 setlinewidth 0 setlinecap -1.9 0 mt 0.8 u 0 0 mt 0.8 u 1.9 0 mt 0.8 u black -2 0.4 mt dot 0 0.8 mt dot 2 0.4 mt dot grestore % 10 10.1 mt dot line1 red 0.33 setgray1 5 3 mt 7 10 rlineto stroke 5 7 mt 8 5 rlineto stroke 5 3 mt 11.5 u 5 15 ledd newpath beige 0.33 setgray1 0.3 setlinewidth 1 setlinecap 0.33 setgray1 3.5 3 mt 3 r 3.5 7 mt 3 r grestore} def beige 0.33 setgray1 3.5 22 parallax 0 0 psd font1 black 1 7.3 (near\nobject) cc 1 3.3 (far\nobject) cc 2 14.8 (ir |4LED|1\nor laser) cc 17.5 10.7 (position\nsensitive\ndetector) cc /font7 /Helvetica-Bold 1 gonzofont /font6 /Symbol 1.2 gonzofont font7 newpath aqua 0.33 setgray1 10 4 (distance = (|jL|j-|jR|j)|j/|j(|jL|j+|jR|j)) cl 12.5 16.5 (L) cc 16 13 (R) cc /font8 /Helvetica 0.8 gonzofont font8 black 3 0.5 ((B) Static Position Sensitive Detector method.) cl 3 19 ((A) Dynamic parallax or "split image" method.) cl ypos snap1 restore /ypos exch def } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /figure2 { % name of textfile: muse.fig.131.2 sharp psd % ............................ save /snap2 exch def systemdict /setstrokeadjust known {true setstrokeadjust} if electronics begin -9 25 10 setgrid % 33 36 showgrid % /grayshade 0.92 def /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse } {pop} ifelse setgray } def % /setgray1 {setgray} def % bypass /green {0.33 settint} def /red {0 settint} def /beige {0.10 settint} def /cstretch 0.02 def /sstretch 0.05 def /kern 0.1 def /yinc 1.1 def /font0 /Helvetica-Bold 1.2 gonzofont /font1 /Helvetica 0.7 gonzofont /font4 /Helvetica 0.7 gonzofont /font3 /Helvetica-Bold 0.70 gonzofont /font2 /Helvetica-Oblique 0.75 gonzofont /font5 /Helvetica-Bold [2 0 0 1.4 0 0] gonzofont /font6 /Helvetica [2 0 0 1.4 0 0] gonzofont /font7 /Helvetica [0.6 0 0 0.6 0 -.3] gonzofont /font8 /Symbol 0.9 gonzofont /font6 /Symbol 0.75 gonzofont /kern 0.1 def /font7 /Helvetica-Bold 1.7 gonzofont /yinc 1.0 def /txtwide 26 def /tabs [-1.5] def /font0 /Helvetica-Bold [1.2 0 0 1 0 0] gonzofont /res {-0.8 0 rmoveto gsave 1.6 0 rlineto line1 grayshade setgray1 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 % patch resistor /psd {gsave translate line1 1 3 mt 1 l 3 d 2 r 1 3 mt 2.5 d 1 r 0 1.5 vresistor gsave -0.7 0.75 mt 1.5 pu 120 rotate 1.5 pu closepath gsave 0.7 0.7 0.7 setrgbcolor fill grestore black line1 stroke grestore beige grestore} def /ledd { gsave translate black line1 0 0.3 mt 0.5 r 0.7 u 2 r 0 -0.3 mt 0.5 r 0.7 d 0.5 r 1.5 u 1.5 r red 1 setlinecap 0.8 setlinewidth 0.33 setgray1 -0.3 0 mt 0.5 l 0 setlinecap 0 0 mt 0.4 l 0.3 setlinewidth 0 -0.6 mt 1.2 u beige grestore}def /baux {gsave translate 0 0 mt 4 pu 6 pr 4 pd closepath gsave grayshade 0.15 sub setgray1 fill grestore 0.33 setgray1 line1 stroke font1 black 3 2.2 (timing and\ncontrol) cc grestore} def /gp2 {gsave translate 0 0 13 9 0.3 roundbox gsave grayshade setgray1 fill grestore 0.33 setgray1 0.4 setlinewidth stroke gsave -2 -2 translate 4.55 5 ledd 5 7 psd 7 4.5 baux grestore black 13 7.5 (4) pincirc 13 5.5 (3) pincirc 13 3.5 (2) pincirc 13 1.5 (1) pincirc font1 1.7 4.8 (psd) cc 1.7 1.6 (led) cc /font7 /Helvetica-Bold 1.2 gonzofont aqua 0.33 setgray1 9 0.6 (GP2D02) cc grestore % get out of box grestore} def /pincirc {gsave /numm exch store translate 0 0 0.45 0 360 arc gsave white fill grestore black line2 stroke font1 0 -0.25 numm cc grestore} def %%%%% black line1 26 6 mt 1 r rground 26 8 mt 4 r circ1 28.2 8 mt larrow 26 10 mt 1.5 r 4 u circ1 26 12 mt 4 rx circ1 29 12 mt rarrow beige 13 4.5 gp2 1 setlinecap 0.4 setlinewidth aqua 0.33 setgray1 4 3 mt 11.5 u beige black font1 27.2 15 (+5|jv) cc 30.7 11.7 (distance out) cl 30.7 7.7 (clock input) cl 7 9.5 (reflective\nobject) cc end ypos snap2 restore /ypos exch def } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /figure3 { save /snap3 exch def % name of textfile: muse.fig.131.3 blocks for rms % ............................ systemdict /setstrokeadjust known {true setstrokeadjust} if electronics begin 28 18 10 setgrid % 33 36 showgrid % /grayshade 0.92 def /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse } {pop} ifelse setgray } def % /setgray1 {setgray} def % bypass /green {0.33 settint} def /red {0 settint} def /beige {0.10 settint} def /cstretch 0.02 def /sstretch 0.05 def /kern 0.1 def /yinc 1.1 def /font0 /Helvetica-Bold 1.2 gonzofont /font1 /Helvetica 0.7 gonzofont /font4 /Helvetica 0.7 gonzofont /font3 /Helvetica-Bold 0.70 gonzofont /font2 /Helvetica-Oblique 0.75 gonzofont /font5 /Helvetica-Bold [2 0 0 1.4 0 0] gonzofont /font6 /Helvetica [2 0 0 1.4 0 0] gonzofont /font7 /Helvetica [0.6 0 0 0.6 0 -.3] gonzofont /font8 /Symbol 0.9 gonzofont /font6 /Symbol 0.75 gonzofont /kern 0.1 def /font7 /Helvetica-Bold 1.7 gonzofont /yinc 1.0 def /txtwide 26 def /tabs [-1.5] def /font0 /Helvetica-Bold [1.2 0 0 1 0 0] gonzofont /block {gsave translate 0 0 3.9 3.9 0.3 roundbox gsave grayshade setgray1 fill grestore line3 0.33 setgray1 stroke /font3 /Helvetica-Bold 0.65 gonzofont font3 1.7 0.3 (1/4|j|jSEC ) cc gsave 3.6 1.95 translate 90 rotate 0 0 ( 1 AMP) cc grestore grestore % get out of box grestore} def /trough {gsave translate 1 setlinecap 1 setlinejoin 0.4 setlinewidth 0.3 [-.5 2 -.5 -.5 17 -.5 17 2 ] roundpath aqua 0.33 setgray1 stroke beige grestore} def beige /single {gsave translate 0 0 trough 0 0 block 4.2 0 block 8.4 0 block 12.6 0 block /font4 /Helvetica-Bold 0.75 gonzofont font3 aqua 0.33 setgray1 19 3.4 (AVERAGE CURRENT = 1 AMP) cl 19 1.7 (RMS CURRENT = 1 AMP) cl 19 0 (AVERAGE POWER = 1 WATT) cl beige grestore} def /double {gsave translate 0 0 trough 8.4 0 block 12.6 0 block 8.4 4.2 block 12.6 4.2 block /font4 /Helvetica-Bold 0.75 gonzofont font3 aqua 0.33 setgray1 19 3.4 4 add (AVERAGE CURRENT = 1 AMP) cl 19 1.7 4 add (RMS CURRENT = 1.414 AMPS) cl 19 0 4 add (AVERAGE POWER = 2 WATTS) cl beige grestore} def /quad {gsave translate 0 0 trough 12.6 0 block 12.6 4.2 block 12.6 8.4 block 12.6 12.6 block /font4 /Helvetica-Bold 0.75 gonzofont font3 aqua 0.33 setgray1 19 3.4 4 add (AVERAGE CURRENT = 1 AMP) cl 19 1.7 4 add (RMS CURRENT = 2 AMPS) cl 19 0 4 add (AVERAGE POWER = 4 WATTS) cl beige grestore} def 0 18 quad 0 7.3 double 0 0 single end ypos snap3 restore /ypos exch def } def %%%% /figure4 { % name of textfile: muse.fig.131.4 noisy sinewave % ............................ save /snap4 exch def 18 3 translate systemdict /setstrokeadjust known {true setstrokeadjust} if electronics begin 5 5 10 setgrid % 33 36 showgrid % /grayshade 0.92 def /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse } {pop} ifelse setgray } def % /setgray1 {setgray} def % bypass /green {0.33 settint} def /red {0 settint} def /beige {0.10 settint} def /cstretch 0.02 def /sstretch 0.05 def /kern 0.1 def /yinc 1.1 def /font0 /Helvetica-Bold 1.2 gonzofont /font1 /Helvetica 0.7 gonzofont /font4 /Helvetica 0.7 gonzofont /font3 /Helvetica-Bold 0.70 gonzofont /font2 /Helvetica-Oblique 0.75 gonzofont /font5 /Helvetica-Bold [2 0 0 1.4 0 0] gonzofont /font6 /Helvetica [2 0 0 1.4 0 0] gonzofont /font7 /Helvetica [0.6 0 0 0.6 0 -.3] gonzofont /font8 /Symbol 0.9 gonzofont /font6 /Symbol 0.75 gonzofont /kern 0.1 def /font7 /Helvetica-Bold 1.7 gonzofont /yinc 1.0 def /txtwide 26 def /tabs [-1.5] def /font0 /Helvetica-Bold [1.2 0 0 1 0 0] gonzofont 1237% 45 srand /fract 0.5 def /funct {1000 random 250 div 2 sub % dup == fract mul exch sin add} def /hscale {15 div} def /vscale {3 mul} def % draw a noisy sinewave /nsine {gsave translate 0 0 mt 0 1 360 {/ang exch store ang hscale ang funct vscale lineto } for line2 stroke grestore} def aqua 0.33 setgray1 5 26.5 nsine beige 0.33 setgray1 4.5 26.5 mt line1 25 r 5 5 mt 14 pu 24 pr 14 pd closepath % basic graph space grayshade setgray1 fill 0.33 setgray1 line3 4.5 5 mt 25 r 5 4.5 mt 15 u % first try on fitting gsave beige 0.33 setgray1 5 5 translate /hscale2 {24 mul} def /vscale2 {1 sub 10 mul } def 0 1.11 moveto /fract 0 def /avg 0 def /rms 0 def 0 0.025 1.0 {/fract exch store /avg 0 def /rms 0 def 100 { 0 1 180 { /ang exch store ang funct /nang exch store % ( ) == % nang == % nang dup mul == flush /avg avg nang add store /rms rms nang dup mul add store } for } repeat % average results???? rms 18000 div sqrt % dup == avg 18000 div % dup == div /ratio exch store % ratio == fract hscale2 ratio vscale2 % dup == flush lineto % ----) == } for gsave 24 0 lineto 0 0 lineto closepath grayshade 0.15 sub setgray1 fill grestore 0.33 setgray1 line2 stroke grestore % end curve 1 setlinecap 0.33 setgray1 line3 4.5 5 mt 25 r 5 4.5 mt 15 u [{5 5 mt 0.5 d} 24 5 div 6] xrpt [{5 5 mt 0.5 l} 2 8] yrpt font1 black gsave 14 1.6 translate line1 -0.3 0.1 mt 6.5 r 3 0.3 (PEAK NOISE) cc 3 -0.8 (PEAK SINEWAVE) cc grestore gsave 0.7 10.5 translate 90 rotate line1 -0.55 0.1 mt 4 r 1.5 0.3 (RMS) cc 1.5 -0.8 (AVERAGE) cc grestore gsave 5 3.2 translate 0 0 (0.0) cc 4.8 0 (0.2) cc 9.6 0 (0.4) cc 14.4 0 (0.6) cc 19.2 0 (0.8) cc 24 0 (1.0) cc grestore gsave 3.2 4.7 translate 0 0 (1.0) cc 0 2 (1.2) cc 0 4 (1.4) cc 0 6 (1.6) cc 0 8 (1.8) cc 0 10 (2.0) cc 0 12 (2.2) cc 0 14 (2.4) cc grestore end ypos snap4 restore /ypos exch def } def %%%%%% /figure5 { % name of textfile: muse.fig.116.5 HTML error codes NOT IN USE % ............................ save /snap5 exch def %%%%%%%%%%%%%%%%%%% electronics begin end ypos snap5 restore /ypos exch def } def %%%%%% /namestretch 0 def /sidebar1 { 8 -3 translate 1 dup scale % adjust to fit /title( )def /font0 /Helvetica [10 0 0 8.5 0 0] gonzofont /font1 /Helvetica [9 0 0 9 0 0] gonzofont /font2 /Helvetica-Bold [9 0 0 9 0 0 ] gonzofont /txtwide 156 def /yinc 11 def % RSNUMBER /Zmacro {gsave /Helvetica-Narrow-Bold findfont [7.5 0 0 7.5 0 0] makefont setfont xpos ypos moveto charstretch 0(CIRCLE ) ashow charstretch 0 RSnumber( ) cvs ashow ( ON FREE INFORMATION CARD) show /RSnumber RSnumber 1 add def /ypos ypos yinc 0.7 mul sub def grestore} def /Ymacro {/ypos ypos yinc 0.7 mul sub def} def % temporary stretch /Zmacro {(h) stringmacro /ypos ypos namestretch sub def } def /ypos0 bt 3 sub def /yinc 17 def /xpos bl def /xpos0 xpos def /pm 0 def /sstretch 0.1 def /cstretch 0.2 def /ypos bt 20 sub def /ypos 400 def /txtwide bw def /colcheck {} def /ytopoflist bt 50 sub csf div def xpos txtwide 2 div add 0 add ytopoflist 18 add % Set name below!!!! ( ) cc % for gray2 /ypos ytopoflist def /columnspacing 158 def /yinc 10 def /xpos0 bl 35 add def /xpos xpos0 def /amacro {/yhold ypos def /ypos ytopoflist def /xpos xpos columnspacing add def /ypos ypos yinc add def} def % temporary for 4 wide /columnspacing 132 def % xpos 18 sub ypos % (|L|2AMX|1 % 11995 Forestgate Dr % Dallas TX 75243 % (800) 222-0193 % |Z % temp for url list /font3 /Helvetica-BoldOblique 9.5 gonzofont font3 /yinc 13 def xpos -30 add ypos (|3Principles of Digital Communication |1(Andrew Viterbi) |h |31997 Error Correcting Code Symposium |1(Harold Mattson) |3Algebraic Algorithims and Error-Correcting Codes |1(John Alton) |3Applicable Algebra Error-Correcting Code Algorithms |1(Beth Th) |3CDMA; Principles of Spread Spectrum Comm |1(Andrew Viterbi) |3Coded Modulation for Fading Channels |1(Hamidreza Jamali) |3Data & Computer Communications |1(William Stallings) |3Engineer's Error Coding Handbook |1(A Houghton) |3Error Correcting Codes |1(John Baylis) |3Error Control Coding |1(Shu Lin) |3Error Control Systems for Digital Communications |1(Stephen Wicker) |3Error Control Techniques for Digital Comm |1(Arnold Michelson) |3First Course in Coding Theory |1(Raymond Hill) |3Introduction to Error-Correcting Codes|1 (Michael Purser) |3Intro to Error Correcting Codes |1(Scott Vanstone) |3Intro Theory of Error-Correcting Codes |1(Vera Pless) |3Theory & Applications of Error-Correction Codes |1(Jiri Adamek) |3Trellis Coding |1(Christian Schlegel) |3Voice & Data Communications Handbook |1(Regis Bates) |3Understanding Data Communications |1(Gilbert Held) |h |1For more details, see |/surl |3www.tinaja.com/amlink01.html|/amlink01 ) cl } def % /sidebar1 {} def % temp lockout %%%% /sidebar2 { 8 -3 translate 1 dup scale % adjust to fit /title ( ) def /font0 /Helvetica [10 0 0 8.5 0 0] gonzofont /font1 /Helvetica [9 0 0 9 0 0] gonzofont /font2 /Helvetica-Bold [9 0 0 9 0 0 ] gonzofont /txtwide 156 def /yinc 11 def /Ymacro {/ypos ypos yinc 0.7 mul sub def} def /Zmacro {(h) stringmacro} def /ypos0 bt 3 sub def /yinc 17 def /xpos bl def /xpos0 xpos def /pm 0 def /sstretch 0.1 def /cstretch 0.2 def /ypos bt 20 sub def /txtwide bw def /colcheck {} def /ytopoflist bt 50 sub csf div def xpos txtwide 2 div add 0 add ytopoflist 18 add % (|2|CNAMES AND NUMBERS) cc ( ) cc % for new graybox /ypos ytopoflist def /columnspacing 158 def /yinc 10 def /xpos0 bl 35 add def /xpos xpos0 def /amacro {/yhold ypos def /ypos ytopoflist def /xpos xpos columnspacing add def /ypos ypos yinc add def} def /downtwo {/ypos ypos 2 sub def} def % temporary stretch /Zmacro {(h) stringmacro /ypos ypos namestretch sub def } def % temporary for 4 wide % /columnspacing 140 def % /xpos xpos 15 sub def xpos ypos (|L|2Amateur TV Quarterly|1 5931 Alma Dr Rockford IL 61108 (815) 398-2683 |Z |2Biomass & Bioenergy|1 PO Box 882 New York NY 10159 (212) 633-3730 |Z |2Brand Electronics|1 421 Hilton Rd Whitefield ME 04353 (888) 433-6600 |Z |2Dallas Semiconductor|1 4401 Beltwood Pkwy S Dallas TX 75244 (972) 371-4000 |Z |2DuPont|1 1007 Market St Wilmington DE 19898 (302) 774-1000 |Z |2Flow Control|1 84 Park Avenue Flemington NJ 08822 (908) 788-0343 |Z |2Fuel Cell Tech News|1 25 Van Zant St Norwalk CT 06855 (203) 853-4266 |Z |2Hamamatsu|1 360 Foothill Rd Bridgewater NJ 08807 (201) 231-0960 |Z |2International Rectifier|1 233 Kansas St El Segundo CA 90245 (310) 322-3331 |Z |2Loctite Corp|1 1001 Trout Brook Crossing Rocky Hill CT 06067 (860) 571-5100 |Z |2MRT/Mobile Radio Tech|1 PO Box 12901 Overland Park KS 66282 (913) 341-1300 |Z |a |2Paragona Art Products|1 PO Box 3324 Santa Monica CA 90408 (310) 264-1980 |Z |2Phillips Business Info|1 1201 Seven Locks Rd Potomac MD 20854 (800) 777-5006 |Z |2Raychem|1 300 Constitution Drive Menlo Park CA 94025 (800) 227-7040 |Z |2RF Design|1 5660 Greenwood Blvd #350 Englewood CO 80111 (303) 793-0448 |Z |2RMT Engineering|1 6863 Buffham Road Seville OH 44273 (330) 887-5535 |Z |2Sensory Systems|1 521 E Weddell Dr Sunnyvale CA 94089 (408) 744-9000 |Z |2Sharp Optoelectronics|1 5700 NW Pacific Rim Blvd Camas WA 98607 (360) 834-2500 |Z |2SPIE|1 PO Box 10 Bellingham WA 98227 (206) 676-3290 |Z |/surl |2Synergetics|1|/synlib01 Box 809 Thatcher AZ 85552 (520) 428-4073 |Z |2United Controls|1 1554 Litton Drive Stone Mountain GA 30083 (770) 496-0884 |Z |2Wireless Integration|1 10 Tara Blvd 5th FL Nashua NH 03062 (603) 891-0123 |Z ) cl } def % temphelp /hackhelp { % nt: hack.help % .. /sstretch 0 def /cstretch 0.1 def /font0 /Helvetica-Bold [8.5 0 0 8 0 0] gonzofont /font1 /Helvetica [8.5 0 0 8 0 0] gonzofont /font2 /Helvetica-Bold [8.5 0 0 8 0 0 ] gonzofont /font7 /Helvetica-Oblique [8.5 0 0 8 0 0] gonzofont /yinc 9.5 def /font2 {font1} def bc bt 15 sub (|0NEED HELP?) cc bl 14 add bt 30 sub (|1Phone or write all your US |2Tech Musings|1 questions to: |h Don Lancaster |2Synergetics|1 Box 809-EN Thatcher, AZ, 85552 (520) 428-4073 |h US email:|j |7don@tinaja.com|1 Web page:|j|j |7www.tinaja.com|1 ) cl } def %%% /f1name (Fig. 1 \261 TWO METHODS of optical rangefinding.) def /f2name (Fig. 2 \261 POSITION SENSITIVE DETECTOR (PSD) module from Sharp \ accurately measures short distances with no moving parts.)def /f3name (Fig. 3 \261 THE SHAPE OF A WAVEFORM very much determines its \ average power. Average current (common to most meters) is meaningless \ for most power measurements. This is a common beginner's mistake.) def /f4name (Fig. 4 \261 ADDING NOISE to a sinewave increases the energy and \ raises its rms to average ratio. Noisy systems often lead to wildly wrong \ conclusions about power and efficiency. And to outrageous "overunity" claims.) def /ad1name ( ) def % dummy /s1name (SOME ERROR CORRECTING CODE BOOKS) def /s2name (NAMES AND NUMBERS) def /helpname (TEMPCHECK) def /Zmacro {/ypos ypos 1 add def 0 setlinewidth xpos ypos moveto txtwide 0 rlineto stroke /ypos ypos -2 add def} def % hair rule /reprogray {bestgray} def bestgray black /header {} def /setstrokeadjust where {pop /setstrokeadjust true def} if muse3 begin /cstretch 0.2 def /sstretch -0.3 def /showthegrid false def /LaserWriterG false def /boxdraw {bl bb bw bh brad roundbox blw setlinewidth stroke grestore } def /br {bl bw add} def /bb 0 def % picojust patch18 gonzo begin /swallow {/lopspaces lopspaces 1 add def printlist plistlength 1 sub get dup 1 get dup 2 ge {1 sub} if 1 exch put} bind def end /rdiode {gsave 180 rotate diode grestore} def % patch /grayshade 0.92 def % for compatibility /showcolors false def % temp for figure one cieF % BBBBBB % name of textfile: muse.116.z % .... % X E % Z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This is needed to improve post picojustufication... gonzo begin /swallow {/lopspaces lopspaces 1 add def printlist plistlength 1 sub get dup 1 get dup 2 ge {1 sub} if 1 exch put} bind def end /wanttousepicojustify true def % this globally turns picojust on or off %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wanttousepicojustify false 40 array dictstack {/^picoset known or} forall not and { % FILL JUSTIFICATION IMPROVER version 6.3 June 3, 1994. c 1994 by % Don Lancaster & Synergetics (602) 428-4073. [support on GEnie PSRT] % Personal use premitted; All commercial & media rights fully reserved. % Install this where it will redefine all print time uses of % the -awidthshow- operator. Use picojust true or false to control. /picoflag true def % selective availability switch /picofract 0.35 def % percentage of excess space to be internalized /picothresh 0.03 def % percentage increment per font change /^picoset true def % job multiple def lockout /picojust {/picoflag exch store} def % use for local turn on or off /awidthshow {1 index 4 index 6 index add add 32 eq not picoflag not or {//awidthshow}{/^msg exch store pop /^cst exch store pop pop /^sst exch store /^cct ^msg length store /^rwd ^msg stringwidth pop store /^sct 0 ^msg {( ) search {pop pop exch 1 add exch}{pop exit} ifelse} loop store /^jwd ^cct ^cst mul ^sct ^sst mul add store /^saj ^jwd dup ^rwd add dup 0 eq {pop 0.0001} if div picothresh div floor picothresh mul picofract 1.33 mul mul 1 add store gsave ^saj 1 scale /^rft 1 ^saj 1 sub ^rwd mul ^jwd dup 0 eq {pop 0.0001} if div sub ^saj div store ^sst ^rft mul 0 32 ^cst ^rft mul 0 ^msg //awidthshow 1 ^saj div 1 scale grestore ^jwd ^rwd add 0 rmoveto} ifelse} bind def } if %%%%%%%%%%%%% SYNERGETICS AD %%%%%%%%%%%%%%%%%% %! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /ad1copy { save /adsave exch store green staytint % IMPORTANT: Comment or remove the next line to get the ad up to EN page size! % Do this **ONLY** if you are extracting the ad for EN layout! % 1.03 1.09 scale xpos 23 sub ypos 283 sub translate 0.95 0.915 scale %%%% This code puts in the reader service number %%%% /showreaderservicenumber true def % now a catalog /readerservicenumber 146 def /squashad true def /showadgrays true def squashad {1 0.80 scale} if /height 693 114 add 60 add def % stretched twice /width1 165 def /bc width1 2 div def % huh /sidethk 4 def /botheight 54 def /topheight 33 def /outrad 10 def /inrad 5 def /pm 0 def /pmnorm 0 def %%%%%%%%%%%%%% KEYSTONE STUFF %%%%%%%%%%%%%%%%%%%%%%% % 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This is a subtle correction to the gonzo fill justify that makes % txtwide slightly more precise ... gonzo begin /reallyjustF {swallowandhang roomleft cstretch add 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 end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % KEYSTONE STUFF STARTS HERE 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 /msg2 exch def /yy1 exch def /xx1 exch def mark {msg2 (\n) search {exch pop exch /msg2 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % outside box 0 0 width1 height 5 roundbox showadgrays {0.3}{0} ifelse setgray1 % for brown border fill % inside box sidethk botheight width1 sidethk 2 mul sub height topheight sub botheight sub inrad roundbox showadgrays {0.96 setgray}{white} ifelse fill black % shade for web /cstretch 0.7 def /sstretch 1.2 def /font1 /Revue 10 gonzofont /font3 /Revue 9 gonzofont /font4 /Revue [9 0 0 9.05 0 1] gonzofont /font9 /Helvetica-Bold 6.5 gonzofont /font2 /Revue 14 gonzofont font1 % adjust center /bc bc sidethk 2 div add def % top lettering white bc bt 22 add (|1new from) cc bc bt 6 add (|2DON LANCASTER) cc bc -17 (|2SYNERGETICS) cc /yinc 10 def bc -28 (|3B|1ox |3809-EN|1 |1Thatcher, |3AZ 85552 |4(|3520|4)|3 428-4073|1) cc /cstretch 0.1 def /sstretch 0.1 def /font5 /Helvetica-Narrow 8 gonzofont /font6 /Helvetica-Narrow-Bold 10 gonzofont /font7 /Helvetica 6 gonzofont /font8 /Helvetica-Narrow-Bold 8 gonzofont /font: /Helvetica-Bold [5 0 0 4.95 0 6] gonzofont % uneven for distillery /font- /Helvetica-Narrow-Oblique 8 gonzofont black 3 3 (|7FREE US VOICE HELPLINE) cl br 3 sub 3 (|7VISA|j/|jMC) cr /xpos 4 def /txtwide br 8 sub def /yinc 8.5 def /ypos bt 15.5 sub def /amacro {/ypos ypos 2 add def} def /cmacro {/ypos ypos 1 add def} def /kern 0.5 def /bw width1 sidethk 2 mul sub def % obtuse code avoids the arcto bug /bmacro { gsave showadgrays {0.3}{0} ifelse setgray % for brown border 0 ypos translate 0 0 mt 5 [-0.5 30 -0.5 3 bw 1 add 3 bw 1 add 30 ] roundpath 0 -31 rlineto bw 1 add neg 0 rlineto closepath fill newpath 0 0 mt 5 [-0.5 -30 -0.5 -3 bw 1 add -3 bw 1 add -30 ] roundpath 0 31 rlineto bw 1 add neg 0 rlineto closepath fill grestore } def /Umacro {ypos} def xpos ypos (|C|6A|kCTIVE|j|j FILTER|j|j COOKBOOK |h|a |C|6RESEARCH|j|j INFOPACKS |h|F|a |5Don's instant use other oneash-and-carry flat rate consulting. Ask any reasonable technical \ question to get a detailed analysis and report. See |/tinton www.tinaja.com/info01|/info01 \ for specifics. \ |8$79.00|5 |b |a |h |F|5The sixteenth|k (!|j)|k printing of Don's bible on analog op-amp lowpass, bandpass, and highpass active filters. De-mystified instant designs. |8 $28.50|1 |b |a |h |C|6CMOS|j|j AND|j|j TTL|j|j COOKBOOKS |h|a |F|5Millions of copies in print worldwide. |8THE|5 two books for digital integrated circuit fundamentals. About as hands-on as you can get. |8$28.50 |5each.|1 |b |a |h |C|6INCREDIBLE|j|j SECRET |h|c MONEY|j|j MACHINE|j|j II |5|h|F|a Updated 2nd edition of Don's classic on setting up your own technical or craft venture. |8$18.50|1 |b |a |h |C|6LANCASTER|j|j CLASSICS|j|j LIBRARY |5|h|a|F Don's best early stuff at a bargain price. Includes the CMOS Cookbook, The TTL Cookbook, Active Filter Cookbook, PostScript video, Case Against Patents, Incredible Secret Money Machine II, and \ Hardware \ Hacker II reprints. |8$119.50|1 |b |a |h |C|6L|kOTS|j|j OF|j|j OTHER|j|j GOODIES |5|h|a) stringgonzo %%%%%%%%%%%%%%%%%%%%%%%% % (A) WIDTH CALCULATIONS 2.20.91 % A new curwide variable lets you calculate the gonzo string % width independent of printing it. Handy for menu justify, etc.. % Use has to be bracketed with /oktoprint false def /oktoadvance % false def --- stuff --- and then true. Works with any justify mode. % make this change to main code so lengths can be extracted. Note that % roomleft gets flushed at line end. gonzo begin /endtheline {/curwide txtwide roomleft sub def justx cvx exec oktoprint {printline} if} bind def % calloutwidth calculates only the width of the string, returning it % to the top of the stack. For consistency with other callouts, use % 0 0 (string) cw. This INCLUDES all stretching and font changes! /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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (B) MENU JUSTIFY 2.20.91 % The cm routine takes a leading string and a trailing string seperated % by a delimiter and places a row of CONSTANT WIDTH, PRECISELY SPACED, % VERTICALLY ALIGNED and WHOLE dots (or whatever) between the two. It % is based on putting down the dots first and ERASING only whole dots % that are not wanted. /menudots (. ) def /menufont {font5} def /mdoteht 3 def /menudelim ( ) def /cropleadingspaces true def % drawmdots draws a line of menu dots, using plain old show /drawmdots { gsave menufont xxm yym moveto txtwide menudots stringwidth pop dup /mdot1 exch def div floor cvi {menudots show} repeat grestore } def % spchomp takes a string and conditionally removes all leading spaces, % returning the truncated string /spchomp {cropleadingspaces {dup 0 exch {32 eq {1 add}{exit} ifelse } forall} if exch dup length 2 index sub 3 -1 roll exch getinterval} def % mlineproc takes the mline string and processes it into a leading string, % the dot row, and a trailing string. Unused dots are erased with logic % to insure whole dots only. Null strings are ignored. /mlineproc {mline length 0 gt {drawmdots mline menudelim search {/lmstr exch def pop spchomp /rmstr exch def } if gsave showadgrays {0.96}{1}ifelse setgray % for web color xxm yym moveto mdoteht setlinewidth 0 0 lmstr cw mdot1 div ceiling mdot1 mul 0 rlineto stroke xxm txtwide mdot1 div floor mdot1 mul add yym moveto 0 0 rmstr cw mdot1 div ceiling mdot1 mul neg 0 rlineto stroke grestore xxm yym lmstr cl xxm txtwide add yym rmstr cr /yym yym yinc sub def} if} def % mj menujustify accepts tabbed string pairs and converts them into % dotted menu listings.. /cm {gsave /msg exch def /yym exch def /xxm exch def { msg (\n) search {/mline exch def pop /msg exch def mlineproc} {/mline exch def mlineproc exit } ifelse} loop grestore} def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % /txtwide 170 def % textwidth /txtwide txtwide 8 sub def /yinc 8 def xpos 4 add ypos 0 sub (Ask the Guru I or II or III $24.50 Hardware Hacker II, III or IV $24.50 Tech Musings V or VI $24.50 Micro Cookbook I $19.50 PostScript Beginner Stuff $29.50 PostScript Show and Tell $29.50 Intro to PostScript Video $29.50 PostScript Reference II $34.50 PostScript Tutorial/Cookbook $22.50 PostScript by Example $32.50 Understanding PS Programming $29.50 PostScript: A Visual Approach $22.50 PostScript Program Design $24.50 Thinking in PostScript $22.50 LaserWriter Reference $19.50 Type 1 Font Format $16.50 Acrobat Reference $24.50 Whole works (all PostScript) $380.00 Technical Insider Secrets |9|kFREE|j|j|j|5 ) cm /txtwide txtwide 8 add def xpos ypos (|F |h|c|c|c |b |a |h |C|6BOOK-ON-DEMAND|j|j PUB|j|j KIT |h|F|a |5Ongoing details on Book-on-demand publishing, a new method of producing books only when and as ordered. Reprints, sources, samples. |8$39.50|5 |b |a |h |C|6THE|j|j C|kASE|j|j A|kGAINST|j|j P|kA|kTENTS |h|F|a |5For most individuals, patents are virtually certain to result in a net loss of sanity, energy, time, and money. \ This reprint set shows you Don's tested and proven real-world alternatives. |828.50|5 |b |a |h |C|6BLATANT|j|j OPPORTUNIST|j|j I |h|F|a |5The reprints from all Don's Midnight Engineering columns. Includes a broad range of real world, proven coverage on small scale technical startup ventures. Stuff you can use right now. \ |8$24.50|5 |b |a |h |C|6RESOURCE|j|j BIN|j|j I |h|F|a |5A complete collection of all Don's Nuts & Volts columns to date, including a new index and his master names and numbers list. |8$24.50|5 |b |a |h |C|6FREE|j|j SAMPLES |h|F|a |5Check Don's Guru's Lair at |-http://www.tinaja.com|5 for interactive catalogs and online samples \ of Don's unique products. Searchable reprints and reference resouces, too. Tech help, hot links to cool sites, consultants. |jemail:|j|- don@tinaja.com|1 ) stringgonzo showreaderservicenumber { /sstretch 0.25 def /cstretch 0.20 def /font1 /Helvetica-Bold [6 0 0 8 0 0 ] gonzofont bc 0 sub botheight neg 10 sub 2 sub %(Write in ) readerservicenumber ( ) cvs mergestr %( on Reader Service Card.) mergestr cc (FREE catalog: http://www.tinaja.com) cc } if adsave restore } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /figure5xx { % name of textfile: muse.fig.106.5 induction heating schematic % ............................ % figure or text starts here ////////////////////////////////////// save /snap1 exch def %%%%%%%%%%%%%%%%%%% electronics begin end ypos snap1 restore /ypos exch def } def %%%%% MUSE PATCHES %%%%% % Version 8.0 Jan 11, 1997 % Insert just before "Name of textfile" on "Z" page. muse3 begin %%%%%%%%%%%%%%%% New colorizer patches %%%%%%%%%%%%%%%%%% /boxgrays 0.92 def /grayshade boxgrays def /mastergray boxgrays def /staytint {0.33 setgray} def /staytint1 {0.25 setgray} def /showadgrays true 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 /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.10 settint} def % examples of convenience operators /aqua {0.52 settint} def /blue {0.67 settint} def /lime {0.44 settint} def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% beige %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % //// REVISED PROC ///// electronics begin % 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 -1 howhigh 2 div 0.7 -90 90 arc 0 stub rlineto howlong 0 rlineto 0 howhigh neg rlineto howlong neg 0 rlineto closepath gsave grayshade setgray fill grestore grayshade dup 1 ne {0.33}{0} ifelse setgray 0.36 setlinewidth stroke newpath -.55 .45 0.15 0 360 arc fill black % ........ 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: grayshade 1 ne {0.33}{0} ifelse setgray /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 black % end cleanup: grestore grestore cleartomark dipsnap restore} def end % get out of electronics? % titleblock, headers and footers /titleblock {save /blurbsnap exch def /colcheck {} def /cstretch 0.2 def sstretch 1 def cml cmt bh1 sub 15 add translate /blurbboxwide 180 def /blurbboxhigh 80 def 1 setlinecap bestgray 3 23 mt hdw 15 sub blurbboxwide sub 3 sub 23 lineto hdw 3 sub 23 moveto -10 0 rlineto [6 0.33 4.5 .85] superstroke hdw blurbboxwide sub 15 sub 0 blurbboxwide blurbboxhigh 5 roundbox gsave grayshade setgray fill grestore % temp expt [4 0.33 2.5 .85] superstroke 0.85 setgray 4.5 setlinewidth -5 23 mt 3 r blurbboxwide 1 add 23 mt 3 r stroke grestore 0.33 setgray /font0 /Palatino-Bold 30 gonzofont /font1 /Palatino-Bold 10 gonzofont /font2 /Palatino-Bold 12 gonzofont font2 4 62 7 add author cl 0.33 setgray font0 3 34 4 add titlename cl font2 4 7 titledate cl 0.20 setgray /yinc 12 def hdw font1 105 sub 60 dokeystone titleblurb cck blurbsnap restore} def /hrule1 {gsave newpath setlinewidth 1 index 4 2 roll moveto lineto stroke grestore} def /leftheader {save /blurbsnap exch def /colcheck {} def cml cmt 16 add translate 0.25 setgray gsave mastergray setgray 0 8 mt 16 setlinewidth hdw r grestore % color fill? 0 0 hdw 1.2 hrule1 0 16 hdw 0.5 hrule1 /cstretch 0.2 def /sstretch 1 def /font2 /Palatino-Bold 11 gonzofont 8 4.5 leftheading cl blurbsnap restore} def /rightheader {save /blurbsnap exch def /colcheck {} def cml cmt 16 add translate 0.25 setgray gsave mastergray setgray 0 8 mt 16 setlinewidth hdw r grestore % color fill? 0 0 hdw 1.2 hrule1 0 16 hdw 0.5 hrule1 /cstretch 0.2 def /sstretch 1 def /font2 /Palatino-Bold 11 gonzofont hdw 8 sub 4.5 rightheading cr blurbsnap restore} def /hrule1 {gsave newpath setlinewidth 1 index 4 2 roll moveto lineto stroke grestore} def /leftfooter { save /blurbsnap exch def /colcheck {} def 0.25 setgray cml cmb 13 sub translate /txtwide 1000 store /font3 /Helvetica 4.5 gonzofont font3 hdw -6 (Copyright c 1998 by Don Lancaster and Synergetics (520) 428-4073 www.tinaja.com \ All commercial rights and all electronic media rights fully reserved. \ Reposting is expressly forbidden.) cr 0 0 hdw 0.8 hrule1 gsave 25 0 translate -18 -7 36 14 2 roundbox gsave mastergray setgray fill grestore 0.5 setlinewidth stroke /font2 /Palatino-Bold 11 gonzofont /cstretch 0.4 def 16 2 add 3.5 columnum ( ) cvs (.) mergestr colpagenum ( ) cvs mergestr cc blurbsnap restore /colpagenum colpagenum 1 add def } def % adjusted for 100 - was -16 -7 32 14 /rightfooter {save /blurbsnap exch def /colcheck {} def cml cmb 13 sub translate /txtwide 1000 store /font3 /Helvetica 4.5 gonzofont font3 0.25 setgray 0 -6 (Copyright c 1998 by Don Lancaster and Synergetics (520) 428-4073 www.tinaja.com \ All commercial rights and all electronic media rights fully reserved. \ Reposting is expressly forbidden.) cl 0 0 hdw 0.8 hrule1 gsave hdw 25 sub 0 translate -18 -7 36 14 2 roundbox gsave mastergray setgray fill grestore 0.5 setlinewidth stroke /cstretch 0.4 def /font2 /Palatino-Bold 11 gonzofont 16 2 add 3.5 columnum ( ) cvs (.) mergestr colpagenum ( ) cvs mergestr cc blurbsnap restore /colpagenum colpagenum 1 add def} def /hackhelp { % nt: hack.help % .. /sstretch 0 def /cstretch 0.1 def /font0 /Helvetica-Bold [8.5 0 0 8 0 0] gonzofont /font1 /Helvetica [8.5 0 0 8 0 0] gonzofont /font2 /Helvetica-Bold [8.5 0 0 8 0 0 ] gonzofont /font7 /Helvetica-Oblique [8.5 0 0 8 0 0] gonzofont /yinc 9.5 def /font2 {font1} def 0 grayshade 1 ne {pop 0.25} if setgray bc bt 15 sub (|0NEED HELP?) cc bl 14 add bt 30 sub (|1Phone or write all your US |2Tech Musings|1 questions to: |h Don Lancaster |2Synergetics|1 Box 809-EN Thatcher, AZ, 85552 (520) 428-4073 |h US email:|j |7|/surl don@tinaja.com|1|/maildon Web page:|j|j |7|/surl www.tinaja.com|1|/tinaja ) cl } def /ad1 {cm3 cmb 1colwide f5h false true /ad1name /ad1copy stdmusefig} def % link /ad1name ( ) def /h1h yinc 14 mul def % height of optional help box end % muse3 template %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /showreaderservicenumber false def /showadgrays true def /ad1copy { save /adsave exch store 0 0 translate % adjusts position on page was -127 % IMPORTANT: Comment or remove the next line to get the ad up to EN page size! % Do this **ONLY** if you are extracting the ad for EN layout! % 1.03 1.09 scale green staytint xpos 23 sub ypos 283 sub translate 0.95 0.915 scale %%%% This code puts in the reader service number %%%% /readerservicenumber 146 def /squashad true def squashad {1 0.80 scale} if /height 693 114 add 60 add def % stretched twice /width1 165 def /sidethk 4 def /botheight 54 def /topheight 33 def /outrad 10 def /inrad 5 def /pm 0 def /pmnorm 0 def %%%%%%%%%%%%%% KEYSTONE STUFF %%%%%%%%%%%%%%%%%%%%%%% % 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This is a subtle correction to the gonzo fill justify that makes % txtwide slightly more precise ... gonzo begin /reallyjustF {swallowandhang roomleft cstretch add 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 end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % KEYSTONE STUFF STARTS HERE 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 /msg2 exch def /yy1 exch def /xx1 exch def mark {msg2 (\n) search {exch pop exch /msg2 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % outside box 0 0 width1 height 5 roundbox showadgrays {0.3}{0} ifelse setgray % for brown border fill % inside box sidethk botheight width1 sidethk 2 mul sub height topheight sub botheight sub inrad roundbox showadgrays {grayshade setgray}{white} ifelse fill black % shade for web /cstretch 0.7 def /sstretch 1.2 def /font1 /Revue 10 gonzofont /font3 /Revue 9 gonzofont /font4 /Revue [9 0 0 9.05 0 1] gonzofont /font9 /Helvetica-Bold 6.5 gonzofont /font2 /Revue 14 gonzofont font1 % adjust center /bc bc sidethk 2 div add def % top lettering white bc bt 22 add (|1new from) cc bc bt 6 add (|2DON LANCASTER) cc bc -17 (|2SYNERGETICS) cc /yinc 10 def bc -28 (|3B|1ox |3809-EN|1 |1Thatcher, |3AZ 85552 |4(|3520|4)|3 428-4073|1) cc /cstretch 0.1 def /sstretch 0.1 def /font5 /Helvetica-Narrow 8 gonzofont /font6 /Helvetica-Narrow-Bold 10 gonzofont /font7 /Helvetica 6 gonzofont /font8 /Helvetica-Narrow-Bold 8 gonzofont /font: /Helvetica-Bold [5 0 0 4.95 0 6] gonzofont % uneven for distillery /font- /Helvetica-Narrow-Oblique 8 gonzofont black 3 3 (|7FREE US VOICE HELPLINE) cl br 3 sub 3 (|7VISA|j/|jMC) cr /xpos 4 def /txtwide br 8 sub def /yinc 8.5 def /ypos bt 15.5 sub def /amacro {/ypos ypos 2 add def} def /cmacro {/ypos ypos 1 add def} def /kern 0.5 def /bw width1 sidethk 2 mul sub def % obtuse code avoids the arcto bug /bmacro { gsave showadgrays {0.3}{0} ifelse setgray % for brown border -0.45 ypos translate 0 0 mt 5 [-0.5 30 -0.5 3 bw 1 add 3 bw 1 add 30 ] roundpath 0 -31 rlineto bw 1 add neg 0 rlineto closepath fill newpath 0 0 mt 5 [-0.5 -30 -0.5 -3 bw 1 add -3 bw 1 add -30 ] roundpath 0 31 rlineto bw 1 add neg 0 rlineto closepath fill grestore } def /Umacro {ypos} def xpos ypos (|/tinton1 |C|6A|kCTIVE|j|j FILTER|j|j COOKBOOK |h|a |F|5The sixteenth|k (!|j)|k printing of Don's bible on analog op-amp lowpass, bandpass, and highpass active filters. De-mystified instant designs. |8 $28.50|1 |b |a |h |/tinton1 |C|6RESEARCH|j|j INFOPACKS |h|F|a |5Don's instant cash-and-carry flat rate consulting service. Ask any reasonable technical \ question for a detailed analysis and complete report. See |/surl www.tinaja.com|j/|jinfo01|/info01g \ for specifics. \ |8$79.00|5 |b |a |h |C|/tinton1 |6CMOS|j|j AND|j|j TTL|j|j COOKBOOKS |h|a |F|5Millions of copies in print worldwide. |8THE|5 two books for digital integrated circuit fundamentals. About as hands-on as you can get. |8$28.50 |5each.|1 |b |a |h |/tinton1 |C|6INCREDIBLE|j|j SECRET |h|c |/tinton1 MONEY|j|j MACHINE|j|j II |5|h|F|a Updated 2nd edition of Don's classic on setting up your own technical or craft venture. |8$18.50|1 |b |a |h |/tinton1 |C|6LANCASTER|j|j CLASSICS|j|j LIBRARY |5|h|a|F Don's best early stuff at a bargain price. Includes the CMOS Cookbook, The TTL Cookbook, Active Filter Cookbook, PostScript video, Case Against Patents, Incredible Secret Money Machine II, and \ Hardware \ Hacker II reprints. |8$119.50|1 |b |a |h |/tinton1 |C|6L|kOTS|j|j OF|j|j OTHER|j|j GOODIES |5|h|a) stringgonzo %%%%%%%%%%%%%%%%%%%%%%%% % (A) WIDTH CALCULATIONS 2.20.91 % A new curwide variable lets you calculate the gonzo string % width independent of printing it. Handy for menu justify, etc.. % Use has to be bracketed with /oktoprint false def /oktoadvance % false def --- stuff --- and then true. Works with any justify mode. % make this change to main code so lengths can be extracted. Note that % roomleft gets flushed at line end. gonzo begin /endtheline {/curwide txtwide roomleft sub def justx cvx exec oktoprint {printline} if} bind def % calloutwidth calculates only the width of the string, returning it % to the top of the stack. For consistency with other callouts, use % 0 0 (string) cw. This INCLUDES all stretching and font changes! /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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (B) MENU JUSTIFY 2.20.91 % The cm routine takes a leading string and a trailing string seperated % by a delimiter and places a row of CONSTANT WIDTH, PRECISELY SPACED, % VERTICALLY ALIGNED and WHOLE dots (or whatever) between the two. It % is based on putting down the dots first and ERASING only whole dots % that are not wanted. /menudots (. ) def /menufont {font5} def /mdoteht 3 def /menudelim ( ) def /cropleadingspaces true def % drawmdots draws a line of menu dots, using plain old show /drawmdots { gsave menufont xxm yym moveto txtwide menudots stringwidth pop dup /mdot1 exch def div floor cvi {menudots show} repeat grestore } def % spchomp takes a string and conditionally removes all leading spaces, % returning the truncated string /spchomp {cropleadingspaces {dup 0 exch {32 eq {1 add}{exit} ifelse } forall} if exch dup length 2 index sub 3 -1 roll exch getinterval} def % mlineproc takes the mline string and processes it into a leading string, % the dot row, and a trailing string. Unused dots are erased with logic % to insure whole dots only. Null strings are ignored. /mlineproc {mline length 0 gt {drawmdots mline menudelim search {/lmstr exch def pop spchomp /rmstr exch def } if gsave showadgrays {grayshade}{1}ifelse setgray % for web color xxm yym moveto mdoteht setlinewidth 0 0 lmstr cw mdot1 div ceiling mdot1 mul 0 rlineto stroke xxm txtwide mdot1 div floor mdot1 mul add yym moveto 0 0 rmstr cw mdot1 div ceiling mdot1 mul neg 0 rlineto stroke grestore xxm yym lmstr cl xxm txtwide add yym rmstr cr /yym yym yinc sub def} if} def % mj menujustify accepts tabbed string pairs and converts them into % dotted menu listings.. /cm {gsave /msg exch def /yym exch def /xxm exch def { msg (\n) search {/mline exch def pop /msg exch def mlineproc} {/mline exch def mlineproc exit } ifelse} loop grestore} def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % /txtwide 170 def % textwidth /txtwide txtwide 8 sub def /yinc 8 def xpos 4 add ypos 0 sub (Tech Musings V or VI $24.50 Ask the Guru I or II or III $24.50 Hardware Hacker II, III or IV $24.50 Micro Cookbook I $19.50 PostScript Beginner Stuff $29.50 PostScript Show and Tell $29.50 PostScript Video & secrets $29.50 PostScript Reference II $34.50 PostScript Tutorial/Cookbook $22.50 PostScript by Example $32.50 Understanding PS Programming $29.50 PostScript: A Visual Approach $22.50 PostScript Program Design $24.50 Thinking in PostScript $22.50 LaserWriter Reference $19.50 Type 1 Font Format $16.50 Acrobat Reference $24.50 Whole works (all PostScript) $380.00 Technical Insider Secrets |9|kFREE|j|j|j|5 ) cm /txtwide txtwide 8 add def xpos ypos (|F |h|c|c|c |b |a |h |/tinton1 |C|6BOOK-ON-DEMAND|j|j PUB|j|j KIT |h|F|a |5Ongoing details on Book-on-demand publishing, a new method \ of producing books only when and as ordered. Reprints, \ sources, samples. |8$39.50|5 |b |a |h |/tinton1 |C|6THE|j|j C|kASE|j|j A|kGAINST|j|j P|kA|kTENTS |h|F|a |5For most individuals, patents are virtually certain to result in a net loss of sanity, energy, time, and money. \ This reprint set shows you Don's tested and proven real-world alternatives. |828.50|5 |b |a |h |/tinton1 |C|6BLATANT|j|j OPPORTUNIST|j|j I |h|F|a |5The reprints from all Don's Midnight Engineering columns. Includes a broad range of real world, proven coverage on small scale technical startup ventures. Stuff you can use right now. |8$24.50|5 |b |a |h |/tinton1 |C|6RESOURCE|j|j BIN|j|j I |h|F|a |5A complete collection of all Don's Nuts & Volts columns to date, including a new index and his master names and numbers list. |8$24.50|5 |b |a |h |/tinton1 |C|6FREE|j|j SAMPLES |h|F|a |5Check Don's Guru's Lair at |-|/surl http://www.tinaja.com|5|/tinaja for interactive \ catalogs and online samples \ of Don's unique products. Searchable reprints and reference resouces, too. Tech help, hot links to cool sites, consultants. |jemail:|j|- |/surl don@tinaja.com|1|/maildon ) stringgonzo showreaderservicenumber { /sstretch 0.25 def /cstretch 0.20 def /font1 /Helvetica-Bold [6 0 0 8 0 0 ]gonzofont bc 0 sub botheight neg 10 sub 2 sub % (Write in ) readerservicenumber ( ) cvs mergestr % ( on Reader Service Card.) mergestr cc (FREE catalog: http://www.tinaja.com (do NOT provide RS number!!) ) cc } if adsave restore } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %%% ADDITIONAL ELECTRONICS PATCHES %%%% electronics begin /npn {gsave newpath exch 0.2 sub exch translate -.1 0 1.2 0 360 arc gsave grayshade dup 1 ne {0.15 sub} if 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 grayshade dup 1 ne {0.15 sub} if 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 /circ3 {gsave currentpoint newpath 0.8 0 360 arc gsave grayshade dup 1 ne {0.15 sub} if pop 1 % try white setgray fill grestore black line1 stroke grestore} def % end % electronics % %%%ZZZZ%%%%%%%%%%%%%% URL PATCHES %%%%%%%%%%%%%%%%%%%%%%%%%%%% % patch definitions... /maildon {(mailto:don@tinaja.com) eurl } def /tinaja {(http://www.tinaja.com) eurl } def /consult {(http://www.tinaja.com/consul01.html) eurl} def /netscape {(http://www.netscape.com) eurl } def /adobe {(http://www.adobe.com) eurl } def /aerp {(http://www.aa.washington.edu/AERP/CRYOCAR/CryoCar.htm) eurl } def /jdisk {(http://www2.hawaii.edu/suremath/jdisk1.html) eurl } def /billb {(http://www.eskimo.com/~billb/freenrg/n-mach.html) eurl } def /cool {(http://www.mtsc.unt.edu/CooLN2Car.html) eurl} def /nts {(http://www.nts.mh.se/~johma/psd) eurl} def /whidbey {(http://www2.whidbey.net/optoinfo/LED_RAQ.html) eurl} def /hack73 {(http://www.tinaja.com/glib/hack73.pdf) eurl} def /hacklib {(http://www.tinaja.com/hack01.html) eurl} def /magic {(http://www.tinaja.com/magsin01.html) eurl} def /fourier {(http://www.tinaja.com/psutils/fourier.ps) eurl} def /zeroharm {(http://www.tinaja.com/psutils/zeroharm.ps) eurl} def /sincat210 {(http://www.tinaja.com/sn210cat.ps) eurl} def /hexapod {(http://www.i-way.co.uk/~storrs/lme/LMEHexapodMachine.html) eurl} def /infosoln {(http://www.tinaja.com/glib/infopack.pdf)eurl} def % power method... /setglib {mark (http://www.tinaja.com/glib/) 2 index 20 string cvs mergestr (.pdf) mergestr /eurl cvx ] cvx def} def /sethtml {mark (http://www.tinaja.com/) 2 index 20 string cvs mergestr (.html) mergestr /eurl cvx ] cvx def} def /setweb {mark (http://www.) 2 index 20 string cvs mergestr (.com) mergestr /eurl cvx ] cvx def} def /magicsin {/msinprop} def /parallax {/parallaxinc} def [ /when2pat /msinprop /magicsin /nuts08 /gramtram /muse112 /hack64 /hack86 /ratholes /hack52 /postflut /emergop4 /resbn67 /muse123 /resbn73 /elesimp /dontsick /muse117 /bannyear /trimode /muse131 /syncat01 /bustpat /resbn66 ] {setglib} forall [ /magsn01 /patnt01 /ismm01 /ismm01 /libry01 /bargte01 /blat01 /advt01 /barg01 /amlink01 /flut01 /santa01 /patnt01 /bod01 /scweb01 /tinaja01 /synlib01 /info01 /picup01 /webwb01 /golly01 /santa01 /hack01 /weblib01 /pseudo01 /info01 /beewb01 ] {sethtml} forall [ /parallaxinc /lindsay /bh /amazon /hotbot /discoverypark /keelynet /homepower /epri /rmi /mgfx /newtek /maxim-ic /tinaja /digital.altavista ] {setweb} forall /papers {(http://cfarx1.harvard.edu/rx_lab) eurl} def /mmt {(http://maisel.as.arizona.edu:8080) eurl} def /nrao {(http://info.aoc.nrao.edu) eurl} def /eskimo {(http://www.eskimo.com/~billb) eurl} def /lindsay {(http://www.keynet.net/~lindsay) eurl } def /adams {(http://www.adams1.com/pub/russadam) eurl} def /aha {(http://www.ahasoft.com/complink.htm) eurl} def /wavelet {(http://www.waveloe.org/wavelet/links.html) eurl} def /drms {(http://www.drms.dla.mil) eurl} def /billb {(http://www.eskimo.com/~billb) eurl} def /info01g {(http://www.tinaja.com/info01.html) eurlg} def %%%%%% % 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 /beige cvx 0 /setgray cvx % turn blue marker off /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 /eurlg {mark % special green for ad % start deferred proc exch % position url string /green cvx 0 /setgray cvx % turn blue marker off /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 %%%%%%% END MUSE PATCHES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% muse3 starttemplate /sstretch -0 def % try even looser /kern 0.5 def /dropindent 38 def % adjust for width of drop cap /sstretch 0 def % looser still /font0 /Times-Bold [52 0 0 54.1 0 -32] gonzofont % normal %/font0 /Times-Bold [45 0 0 54.1 0 -32] gonzofont % narrow M /font: /Times-Roman [9.5 0 0 -9.5 0 4.5 ] gonzofont /font9 /Times-Roman [6.8 0 0 7.0 0 -3] gonzofont % squared subscript /font= /Times-BoldItalic [9 0 0 9 0 0 ] gonzofont % subtitles /font9 /Symbol 9.5 gonzofont % delta /kern 0.5 def % Command Summary: % |0 - small caps font |1 - normal text font |2 - italic text font % |3 - bold text font |4 - caps text font |6 - header font % |F - fill justify |L - left justify |z - zero indent % |p - normal indent |y - negative linefeed |8 - header font % |g - start gonzo |x - stop gonzo |a - start drop cap % |b - main body text |c - start sub header |d - end sub header % |o - complement char /sstretch 0 def % /font9 /Symbol [9 0 0 0 0 0] gonzofont % delta /kern 0.5 def /font; /Times-Roman [6 0 0 6.01 0 3] gonzofont % square root symbol and gonzo box autoposition linker /topstrlist {mark 3 1 roll {/roomleft exch roomleft exch sub def printlist exch 3 index exch put exch 1 add exch} /exec cvx ] cvx def} def /boxit{ gsave line1 currentpoint translate -1 -3 mt 10.5 pu 50.5 pr 10.5 pd closepath line1 stroke grestore} 0 topstrlist /sqrtsymbol {gsave currentpoint translate line1 3 3 moveto 2 -5 rlineto 4 12 rlineto 32 0 rlineto stroke grestore} 0 topstrlist % TEXT STARTS HERE startgonzo |a A |b n ability to exactly measure short distances is very \ much in demand. I do get a lot of \ |/surl |2InfoPack|1|/info01 queries over this topic. It turns out there \ is one highly effective, eminently usable, and little \ known static optical rangefinding dx technique known as\274 |c Position Sensitive Detectors |d Look way on down the street. Now look at the tip of your \ nose. Do you see how your eyes tilt inward to view a closer \ object? This is the basis of the |2parallax|1 distance \ measurement method of figure |41-A|1. You probably also know this as the |2split image|1 \ method, commonly used in military spotting and better \ grade cameras. If you know your baseline width and the \ tangent of the inward tilting angle, you calculate \ distance by using \274 |h|/staytint1 distance = baseline|j|j|jx|j|j|jtan|j|9q|1 |h|/black |FYour results can be quite accurate close in, but get \ progressively worse as the angle nears ninety \ degrees and its tangent approaches infinity. The trick is to come up with some method that uses \ parallax but has no moving parts. And your secret lies in \ figure |41-B|1. Shine some infrared light on an \ object. Use a laser for accuracy or a plain |4LED|1 \ in a cheaper system. Focus the returned light on a \ special semiconductor device. The |2position|1 of the \ light should move from right to left across the device as a \ function of the distance. Measure position \ to sense distance. In a totally \ static system. Now your "special semiconductor device" could be nothing \ but a pair of side-by-side |4IR|1 photodiodes. But it turns \ out there \ are |2position sensitive \ detector|1 chips that do a better job. There is one inside trick: How do you make the system \ respond only to the position of the reflected \ light and not to \ the intensity? Simply by use of \ |2normalizing|1. Let |4L|1 be the intensity returned by \ the left side of the sensor and |4R|1 be the intensity \ returned by the right side of the sensor. Then \ you can go ahead and calculate\274 |h|/staytint1 position = (|jL|j-|jR|j)|j/|j(|jL|j+|jR|j) |h|/black This returns an "amount of offset" independent of the \ actual strength of the light. The offset is \ then related to distance as a tangent function. Yeah, \ the division is hard to do analog, but is no big deal \ digitally. |2Sharp Optoelectronics|1 has a nice |4GP2D02|1 chip that \ can do all the work. Details are shown in figure two. You arrange \ your optics so the reflected infrared moves across their \ chip as a function of distance. The built-in |4IR|1 diode \ pulses your target. The return image traverses across their \ internal position sensitive detector. Goodies \ in the chip do the needed difference sensing, |4A/D|1 \ conversion and |4DSP|1. Your output is a serial 8-bit digital number. This number \ is easily related to distance using a calibration curve \ and table lookup. A |2Basic Stamp|1 or a |4PIC|1 is ideal \ to gather and display the range info. See the Sharp data \ sheet for timing and readout info. The measurement cycle takes |470|1 milliseconds, followed by \ eight clock pulses of |40.2|1 milliseconds maximum and a \ stop pulse of |41.5|1 milliseconds. The effective range of this chip is |48|1 to |4120|1 \ centimeters, or roughly three to forty inches. The supply \ current is |417|1 mils operating and |48|1 mils standby \ on a five volt supply. A few obvious uses include camera autofocus, parking \ lot or garage auto obstacle avoidance, and autopower for hand \ driers. Plus, of course, scads of close-in robotic \ sensing apps. These work best with |2specular|1 or diffuse \ reflection. Yes, any hot spots could be a problem. But the \ infrared system is largely color independent. Fancier \ techniques can get added if other ranges are needed. Sharp also has announced |4GPD212|1 analog and \ |4GPD215|1 digital devices. These are \ stand-alone and need no external computer control. They \ also offer |4PD3101|1 and |4PD3151|1 detector \ |4PSD|1 chips they intended for camera auto-focus uses. One \ competitor is |2Hamamatsu|1 with their |4S4282-11|1 and \ |4S4282-72|1 devices. A second alternate |4PSD|1 \ supplier is |2Ricoh|1. One source for further |4PSD|1 info \ is |5SPIE|1, also the |2Society of Photo Optic \ Engineers|1. Their Proceedings |4#2002|1 on \ |2Photodetectors and Power Meters|1 is one possible \ starting point. A |4PSD|1 fundamentals tutorial can be found at \ |/surl |2www.nts.mh.se/~johma/psd|1|/nts An really great |4FAQ|1 on just about everything involving \ |4LED|1's can be downloaded at \ |/surl |2www2.whidbey.net/o|/whidbey |/surl ptoinfo/LED_FAQ.html|1|/whidbey I have got a \ detailed custom |2InfoPack|1 available on optical rangefinding. See |/surl |2www.tinaja.com/info01.html|1|/info01 |c Another Look at AC Power Measurement |d Until quite recently, it had been very \ difficult to accurately measure ac power. Especially in \ the presence of any strange waveshapes, reactive energy, \ noise, or sparking. Nearly all casual measurements tend \ to end up |2low|1. Often ridiculously so. Leading to \ all sorts of pathetic claims which relate to circuit \ "efficiencies" and to "overunity" operation.|p All average responding voltmeters and ammeters are \ useless for much of real world power measurment. So is \ staring at some oscilloscope without having the foggiest \ clue what you are looking at. All of which leads us to \ beginning e.e. student blunder |4#01-A|1. That of \ confusing average and rms voltage or current. I'd like to return to this topic one more time, hitting \ it from a slightly different angle. We'll start with \ these fundamental rules\274 |h|C|/staytint1 |2instantaneous power |j|j= instantaneous voltage |j|jx instantaneous current |h|L|1|/black and\274 |2|C |h |/tinton1 efficiency = |/tinton1 average power out / |/tinton1 average power in |h|1|/black |FThe latter will |2always|1 be a number from 0 to a tad \ under 1. This value often gets multiplied by one hundred \ to get a percent efficiency from 0 to |499.9|1 The \ losses will almost always be in the form of \ low grade heat. Any percent efficiency above |4100|1 |2is|1 experimental \ error. Or (in the case of a heat pump) does not \ account for all of the energy inputs. Every time. Fer sure. Suppose you have a box with two terminals on it. Make a \ |2very brief|1 and a |2simultaneous|1 measurement of your \ voltage and the current. Brief enough that neither one \ changes much during your measurement time. And clean \ enough that noise will not be a factor. Accurately multiply \ these two values together to get your instantaneous \ power. Sum these over time and then divide by the number of \ samples to get average power. If the voltage and current samples are both positive or both \ negative, then your box is acting as a \ |2load|1. The box should be getting hot, adding to its \ internal |4E|1 and |4H|1 energy fields, doing work, or otherwise \ converting energy into some other form. If measured voltage and current have opposite signs, \ your box acts as a |2source|1. Your \ box is cooling down, removing \ strength from its internal energy fields, is being \ mechanically worked upon, or otherwise should be converting \ energy from other inputs into output electricity. Sometimes a box might |2cyclically|1 accept energy \ and then later return it. Which happens when \ internal electric or magnetic fields are getting \ bigger or smaller. We refer to this back and forth process \ as |2reactive energy|1. Because of reactive energy, an ac \ motor will typically act as a load for most of the time, \ but as a source for the remainder. We did see examples of \ this back in |/surl |4MUSE123|1|/muse123 . |/red |/staytint |2All reactive power will average to zero over the long \ term|1. |/beige |/black For accurate results, |2you multiply first and \ average last|1. Why? Because average first and \ multiply last almost always gives you |2low|1 \ results. The average of products is |2not|1 the same as \ the product of averages! |c Playing With Blocks |d Suppose you have got four wooden blocks. Each block is \ labeled as |41.0|1 ampere of current high and is labeled \ as |40.25|1 seconds of time wide. Suppose further that \ you've got a time bin which is one second wide. Should it \ matter how you pile your blocks into your bins? Can the \ exact |2arrangement|1 of the four blocks affect your circuit \ power? Assume a one ohm resistive load for now. Later on, the \ type and size of load will not matter. In Figure 3, we first place all four blocks side by side. \ Uh, the average current is obviously one ampere. The energy \ in your first quarter second will be |40.25|1 watt \ seconds. The energy in quarters two through four should \ also be |40.25|1 watt seconds. Your total energy will be \ one watt second, and the average power \ will be one watt. So far so good. If we replaced our blocks with a \ continuous block that had |2equivalent heating \ power|1, it also would result in an average current of \ one amp and and an average power consumption of one watt. Now stack your four blocks up two high, and an amazing \ thing happens. You still have one ampere of average \ current, because we have two amps for half a second and \ zero amps for half a second. But during your active half \ second, either the input voltage had to double or else the \ circuit load resistance halved. Using our above formula, the \ power in the first quarter second will now be |2two|1 watts. The power in your second quarter second should also be \ |2two|1 watts. The power in the third and fourth quarter \ seconds should be zero. |2The average power should be \ |5TWO|2 watts!|1 Hmmm. In one group, a one amp average current gives us \ one watt of average power. In the second, a one amp \ average current will give us two watts of average power. |/red |/staytint1 |2Average current is meaningless when \ calculating power|1|/tintoff . |/beige |/black We instead have to find out what \ |2continuous|1 equivalent current would give us the identical \ average power. |/beige |/black Well, our power turns out to be current \ |2squared|1 times load resistance for a resistor. Or \ input current |2times|1 input voltage for any load. Done either way, your equivalent "dc" continuous current needed \ turns out to be related to the |2square root|1 of your \ average power. In this case, an average input \ current of |41.414|1 amps gives you an average \ output power of exactly two watts. You might visualize this average continuous \ current as an "equivalent dc heating power" waveform. Or \ you can call this current the |2rms|1 current. And short \ for |2root-mean-square|1. And |2rms|1 is simply the \ results you'll get from counting the blocks and seeing what \ each one does. Reviewing: Your stacked average current will be \ |41.00|1 amp, but the rms current is |41.414|1 amps. \ Clearly, any average responding ammeter (typical of \ most meters in use today) ends up reading low by \ |441%|1! Wait. It gets worse. Stack all \ four blocks up on top of each other. Your average current is \ still one amp. The power in the first quarter second \ will be |2sixteen|1 watts. But the power in the other \ time slots will end up zero. The average power will be \ |2four|1 watts! Once again, your average current reads low enough to be \ meaningless. The equivalent dc heating current or the \ rms current will be two amps. |2An average meter \ here gives you a one hundred percent error!|1 What about sine waves? We did lots of fancy block piling \ on back in |/surl |4MUSE112.PDF|1|/muse112 . You can pile up tiny blocks or use \ fancy math or use the simulator we will look at below to \ conclude that the average value of a half sinewave \ is |40.684|1 of peak; that the rms value of a sinewave \ is |40.707|1; and that the ratio of peak to average is \ found to be |41.1106|1. But |2only|1 for |2whole|1 cycles! Cheap averaging meter suppliers cheat and \ relabel their ac scales high by eleven percent. Such an \ averaging meter is |2totally|1 useless to measure ac \ power. First because of partial cycles or possible \ strange waveforms. And second, because of reactive \ currents that place instantaneous voltages and currents \ out of phase. Summing up: Your average power depends upon the \ |2duty cycle|1 and the |2shape|1 of the waveform involved. \ One proper way to measure your average power is to take many \ narrow e and i samples. You multiply your \ samples together to find instantaneous power, sum the \ samples to get accumulated power, and divide by the \ number of samples. Carefully done over either a very \ long time or an integer number of full cycles. Since analog multipliers get into severe |2crest \ factor|1 problems, digital is the only way to go \ here. A number of effective low cost ac power measurement tools \ are found at |2Brand Electronics|1. And, yes, these \ can easily deal with strange or unusual waveforms. Click their \ banner link at |2www.tinaja.com|1 These days, it is simple enough to use a |4PIC|1 and \ simultaneous |4A/D|1 chips like the |2Maxim|1 \ |4MAX125/126|1 to make the |412,000|1 or more \ |2minimum|1 samples per second and the digital \ multiplies needed to do the job right. Most any \ better grade |4PC|1 data acquisition plug in can also be \ used with care. Regardless, |2knowing your precise waveforms|1 is crucial. |c What About Noise? |d A question came up on the web over what effect noise has \ on power waveforms. Such as noise caused by the bubbling \ in a cold fusion cell or the cavitation in a Griggs pump. Figure four shows what happens if you add \ random noise energy to any sinewave. As expected, the \ ratio of rms to average goes up. Causing any average responding \ meter to further under-report. By an astounding coincidence, the under-reporting seems \ to end up the same size as certain overunity \ claims. Proving that free energy \ enthuasiasts are a source of noise. Such simulations can be both trivial and fun to do using \ PostScript. \ These models also let you use simple math to \ replace fancy calculus and related advanced \ calculations. I've posted the sourcecode for the simulation and figure \ four artwork to my |/surl |4MUSE131.PDF|1|/muse131 |c Error Correcting Codes |d Say you add one bit to a data word designed to always make \ the number of ones in the word |2even|1. Test that bit \ on reception. Should you have an odd number of ones, then \ an error likely has occured. You then can ask for a \ correcting retransmission. This gives an example of a simple |2parity|1 check. Now \ arrange all of your words into blocks. Add parity to row and \ column. This time, on reception, a row parity violation \ and a column parity violation often can "point" to a \ problem bit that can be fixed. You've got an |2error \ correcting code|1. By looking at fancier combinations of bits using \ |2polynomial|1 math, you can conjure up codes that can \ correct themselves better and can do so even in the presence of \ multiple errors. I've gathered together a few of the books \ on error correcting code as this month's resource \ sidebar. The classic text is A. |k|kVitribi's |2Principles of \ Data Communications|1, but \ it is out of print and may be hard to find. More info on all these titles is up at \ |/surl |2www.tinaja.com/amlink01.html|1|/amlink01 |c New Tech Lit |d From |2Phillips Business Info|1, a free |2North \ American Satellite Access|1 wall chart. From \ |2Sensory Systems|1, details on a |2Voice \ Dialer|1 speech recognition chip intended for telephone \ uses. From |2Dallas|1, the new booklet on |2Thermal \ Management|1 chips. They've got some \ really interesting, accurate, and low cost chips \ here. A well done tutorial on |5RFID|1 radio frequency \ identification appeared in |2R.F. Design|1 for July \ |498|1, pp |438-44|1. More details on "pushme-pullyou" |2Hexapod|1 machine \ systems that can be amazingly accurate, quite simple, and \ completly eliminate sliding ways are found at \ |/surl |2|2www.i-way.co.uk/~stor|/hexapod |/surl rs/lm e/LMEHexapod\ Machine.html|1|/hexapod Some related tutorial info is found at \ |/surl |2www.tinaja.com/flut01.html|1|/flut01 Tech magazine update: Check out the |2Amateur Television \ Quarterly|1; a |4$$$|1 |2Fuel Cell Technology News|1; that \ |5MRT|1 which used to be |2Mobile Radio Technology|1; \ |2Flow Control|1 on fluid handling; |2Wireless \ Integration|1; and |2Biomass & Bioenergy|1. An |2Electronics Bench Reference|1 has been \ labor-of-love published by Dick Tormet. It is full \ of useful data. Available through \ |5RMT|2 Engineering|1. Low cost "Cash and Carry" \ |/surl |2InfoPack|1|/infosoln consulting services can now be found at \ |/surl |2www.tinaja.com/info01.html|1|/info01 From |2Loctite|1, a booklet on light cure technology. \ These are adhesives that set up in the presence of \ strong ultraviolet light. Also a good review of uv \ fundamentals. From |2DuPont|1 details on their upgraded \ |2Somos |57100|1 stereolithography resins. These can be \ used in Santa Claus machines. For other suppliers and \ background info, see |/surl |2www.tinaja.com/santa01.html|1|/santa01 Lots of free samples this month. A large packet of \ Shottky power diodes from |2International Rectifier|1; \ some really good |2NukeTape|1 silicon rubber splicing \ tape from |2United Controls|1; and |2SiBar|1 thyristor surge \ protectors from the folks at |2Raychem|1. |2Wireform|1 is a new flexible screen product \ from |2Paragona Art Products|1. This should have all \ sorts of mockup and prototyping uses as \ well. For most individuals and smaller scale startups most of \ the time, any involvement whatsoever with patents is \ nearly certain to end up a net loss of time, energy, \ money, and sanity. Details in my |/surl |2Case Against \ Patents|1|/patnt01 package, along with my tested and proven \ real-world alternatives. See my nearby |/surl |2Synergetics|1|/synlib01 ad for full details. Bunches of surplus test equipment, optics, and \ robotics bargains are now up at \ |/surl |2www.tinaja.com/bargte01.html|1|/bargte01 Even a full \ |4PC|1 plate-thru lab. The latest additions to my |2Guru's Lair|1 website \ include a free technical user forum; fast "power \ nav" buttons; more on buying military surplus; on \ finding test equipment manuals; new typesetting secrets; \ and some updates on |/surl |2Book-on-demand|1|/bod01 publishing. As usual, most of these mentioned items appear in a \ |2Names & Numbers|1 sidebar. Be sure to check here \ before calling our no-charge |4US|1 technical helpline \ I've mentioned in that |2Need Help?|1 box you'll find nearby. Let's \ hear from you. |/tinton1 |-F |x %%%%% Module to insert eight pdf menu options .... % Place after |x but before last showpage % work out an HTML like PDF response /button { makeurlx % make box shaped url gsave blue % settint xpos ypos 0.9 sub translate 0.1 dup scale 0 0 mt 28 pu 28 pr 28 pd closepath 0.85 setgray fill 0 0 mt 0 28 pu 4 -4 rlineto 20 pd 20 pr 4 -4 rlineto closepath 0.6 setgray fill 0 28 mt 28 pr 28 pd -4 4 rlineto 20 pu 20 pl closepath 0.75 setgray fill 8 8 mt 12 pu 13 -6 rlineto closepath 0.33 setgray fill grestore xpos ypos mt } def %%%%%%%%%%% 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 /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 % text link specific data /syncat01 {(http://www.tinaja.com/glib/syncat01.pdf) eurl} def /ismm01 {(http://www.tinaja.com/ismm01.html) eurl} def /amlink01 {(http://www.tinaja.com/amlink01.html) eurl} def /tinaja01 {(http://www.tinaja.com/tinaja01.html) eurl} def /info01 {(http://www.tinaja.com/info01.html) eurl} def /barg01 {(http://www.tinaja.com/barg01.html) eurl} def /advt01 {(http://www.tinaja.com/advt01.html) eurl} def /maildon {(mailto:don@.tinaja.com) eurl} def % button link specific data /syncat01x {(http://www.tinaja.com/glib/syncat01.pdf) button} def /ismm01x {(http://www.tinaja.com/ismm01.html) button} def /amlink01x {(http://www.tinaja.com/amlink01.html) button} def /tinaja01x {(http://www.tinaja.com/tinaja01.html) button} def /info01x {(http://www.tinaja.com/info01.html) button} def /barg01x {(http://www.tinaja.com/barg01.html) button} def /advt01x {(http://www.tinaja.com/advt01.html) button} def /maildonx {(mailto:don@.tinaja.com) button} def % %%%%%%%%%%%%%%%% end links directory %%%%%%%%%%%%%%%%%%%%%%%%%%%% /menu8 {gsave translate save /dosnap exch def /ybot -9999 def /ylimit -9999 def font3 font0 0 0 10 setgrid % 50 50 showgrid /cstretch 0.015 def /sstretch 0.015 def /font0 /Revue 1.2 gonzofont /font1 /StoneSans-Bold 1.3 gonzofont /font3 /Helvetica-Bold 3 gonzofont /kern 0.1 def 0 0 50 22.5 1 roundbox % clip gsave aqua 0.33 setgray fill % gsave % 0 27 mt 3 pu 50 pr 3 pd closepath 0.33 setgray fill % grestore % 0.33 setgray stroke white font3 /cstretch 0.1 def 25 20.5 (|0PLEASE |j|jCLICK |j|jHERE |j|jTO\274 ) cc /cstretch 0.015 def 0.5 2.2 49 17.3 0.8 roundbox 0.75 setgray fill % /yinc 3.5 def black font1 2.3 13.5 (|/syncat01x |1 Get a Synergetics |/surl catalog|/syncat01 ) cl 2.3 10 (|/ismm01x |1 Start your |/surl tech venture|/ismm01 ) cl 2.3 6.5 (|/advt01x |1 Sponsor a display |/surl banner|/advt01 ) cl 2.3 3 (|/info01x |1 Find |/surl research|/info01 solutions) cl 25 13.5 (|/maildonx |1 Send Don Lancaster |/surl email|/maildon ) cl 25 10 (|/barg01x |1 Pick up surplus |/surl bargains|/barg01 ) cl 25 6.5 (|/tinaja01x |1 Find out what a |/surl tinaja|/tinaja01 is) cl 25 3 (|/amlink01x |1 View recommended |/surl books|/amlink01 ) cl grestore dosnap restore} def 57 134 menu8 %%%%%%%%%%%% end pdfmenu8 %%%%%%%%%%%% showpage % this optionally displays the figures /prodart false def prodart { % redefine figures /fig1x {40 50 2colwide f1h true true /f1name /figure1 stdmusefig} def % link /fig2x {40 50 2colwide f2h true true /f2name /figure2 stdmusefig} def % link /fig3x {40 50 2colwide f3h true true /f3name /figure3 stdmusefig} def % link /fig4x {40 50 2colwide f4h true true /f4name /figure4 stdmusefig} def % link /helpx {50 200 1colwide h1h true false /helpname /hackhelp graymusefig} def /ad1 {100 100 1colwide f5h false true /ad1name /ad1copy stdmusefig} def % link % run color sequence /grayshade 0.92 def 1.5 dup scale {0 0 0.9 fig1x} exec showpage /narrowfig 0 def 1.5 dup scale {0 0 0.9 fig2x} exec showpage /narrowfig 0 def /narrowfig 0 def 1.5 dup scale {0 0 0.9 fig3x} exec showpage /narrowfig 0 def /narrowfig 0 def % landscape 30 0 translate 1.5 dup scale {0 0 0.9 fig3x} exec showpage /narrowfig 0 def /narrowfig 0 def 1.5 dup scale { 0 0 0.9 fig4x} exec showpage /narrowfig 0 def /surl{}def /maildon{} def /tinaja {} def -100 150 translate 1.5 dup scale {0 -6 1 help} exec showpage % turn off colors /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse } {pop} ifelse setgray } def /grayshade 1 def /urlx 50 def % temp? /urly 50 def /tinton1 {} def /tinton {} def 1.5 dup scale {0 0 0.9 fig1x} exec showpage /narrowfig 0 def % landscape -30 0 translate 1.5 dup scale {0 0 0.9 fig2x} exec showpage /narrowfig 0 def /narrowfig 0 def % landscape -30 0 translate 1.5 dup scale {0 0 0.9 fig3x} exec showpage /narrowfig 0 def /narrowfig 0 def 1.5 dup scale { 0 0 0.9 fig4x} exec showpage /narrowfig 0 def /surl{}def /maildon{} def /tinaja {} def -100 150 translate 1.5 dup scale {0 -6 1 help} exec showpage /showreaderservicenumber true def /showadgrays false def /tinton1 {black} def 1.5 dup scale {0 31 21 add 1 ad1} exec showpage 0 -400 translate 1.5 dup scale {0 31 21 add 1 ad1} exec showpage } if