%! % Name of file: Tech Musings 122 % 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 28 mul def % height of figure one /f2h yinc 21 mul def % height of figure two /f3h yinc 28 mul def % height of figure three /f4h yinc 48 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 31 mul def % height of custom sidebar /s2h yinc 28 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 1 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 3 sub 4 add 2colwide f3h true true /f3name /figure3 stdmusefig} def % link /fig4 {cm1 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 /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} {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} % {16 -34 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 f4h sub cmb {txw}] % column1 ship [ cm2 cmt f4h sub cmb {txw}] % [ cm3 cmt cmb {txw}] % yinc sub?? ] [ [{leftfooter} {leftheader} {/namestretch 1 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 [ 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 {29 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 (Atmel's PIC challenger HP's new ScanJet 6100C Finding satellite imagery Broadband |jphase |jshifters Understanding Quadrature ) def /author (Don Lancaster's) def /titlename (T|k|kech M|k|kusings) def /titledate (March, 1998 |j) def /leftheading ( Tech Musings) def /rightheading titledate def /columnum 122 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /figure1 { % name of textfile: muse.fig.121.1 Sin and cosine bike wheel % ............................ save /snap1 exch def systemdict /setstrokeadjust known {true setstrokeadjust} if electronics begin 15 25 10 setgrid % 30 55 showgrid /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse } {pop}ifelse setgray } def /green {0.33 settint} def /red {0 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.85 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 /yinc 0.9 def /bikewheel{gsave translate line1 gsave green 0.33 setgray1 40 {0 0 mt 5 r 10 rotate} repeat grestore newpath 0 0 4.9 0 360 arc 0.8 setlinewidth gsave beige 0.48 setgray1 stroke grestore 0.65 setlinewidth 0.52 setgray1 stroke % trick for b/w newpath 0 0 4.5 0 360 arc 0.3 setlinewidth black stroke newpath 0 0 0.4 0 360 arc gsave beige grayshade 1 ne {0.33 setgray}{1 setgray} ifelse fill grestore beige 0.33 setgray1 black line2 stroke newpath 0 0 0.15 0 360 arc black fill gsave 60 rotate red 0.33 setgray1 1 setlinecap 1 setlinejoin 0.6 setlinewidth 4.5 0 mt 1 pr .8 .8 rlineto -.8 -.8 rlineto .8 -.8 rlineto stroke grestore grestore} def /ampl 5 def /perd 10 def /res 5 def /sinewave {gsave translate beige line2 newpath 0 0 mt 0 res 360 {/ang exch store ang perd mul 360 div ang sin res mul lineto } for gsave grayshade 0.15 sub setgray1 fill grestore stroke line1 beige 0.25 setgray1 -0.5 0 mt perd 1 add r grestore} def /cosinewave {gsave translate beige line2 newpath 0 5 mt 90 res 360 90 add {/ang exch store ang 90 sub perd mul 360 div ang sin res mul lineto } for gsave 5 pd perd pl closepath grayshade 0.15 sub setgray1 fill grestore stroke line1 beige 0.25 setgray1 -0.5 0 mt perd 1 add r grestore} def /reddot {gsave translate red 0.33 setgray1 2.5 dup scale 0 0 mt dot grestore} def % startfig 20 6 bikewheel 2 6 sinewave 2 2.5 .667 mul add 5 .866 mul 6 add reddot gsave 20 24 translate -90 rotate 0 0 cosinewave grestore 20 5 .500 mul add 24 2.5 .667 mul sub reddot font1 black 26.2 5.7 (0 degrees) cl 24.5 9.7 (60 degrees) cl 20 -0.5 (270 degrees) cc 8 14.5 beige (the |/tinton1 |3IN-PHASE|1|/tintoff channel\nwill respond \ only to the\nup and down ribbon motion.) cc 13 24 beige (the |/tinton1 |3QUADRATURE|1|/tintoff channel\nwill respond \ only to the back\nand forth ribbon motion.) cc end ypos snap1 restore /ypos exch def } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /figure2 { % name of textfile: muse.fig.121.2 SSB Quadrature method % ............................ save /snap2 exch def systemdict /setstrokeadjust known {true setstrokeadjust} if electronics begin 75 30 10 setgrid % 30 55 showgrid /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse }{pop} ifelse setgray } def /green {0.33 settint} def /cstretch 0.02 def /sstretch 0.0 def /kern 0.1 def /yinc 1.1 def /font0 /Helvetica-Bold 1.2 gonzofont /font1 /Helvetica 0.85 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 /yinc 0.9 def /box46 {gsave /msg exch store translate beige line2 0 0 mt 4 pu 6 pr 4 pd closepath gsave grayshade 0.15 sub setgray1 fill grestore 0.33 setgray1 stroke black 0 setgray1 font1 3 2.6 msg cc grestore} def /multi {gsave translate newpath 0 0 1 0 360 arc gsave beige grayshade 0.15 sub setgray1 fill grestore line3 0.33 setgray1 stroke 0.25 setgray1 /font- /Helvetica-Bold [1.8 0 0 1.4 0 0]gonzofont font- 0 -0.5 (X) cc grestore} def /adder {gsave translate newpath 0 0 1 0 360 arc gsave beige grayshade 0.15 sub setgray1 fill grestore line3 0.33 setgray1 stroke 0.25 setgray1 /font- /Helvetica-Bold [2.2 0 0 2.2 0 0]gonzofont font- 0 -0.5 (+) cc grestore} def %%%% start fig line1 4 4 mt 1.5 l 6 u 1.5 r 2.5 7 mt dot 2.5 7 mt 2.5 l circ1 1.5 7 mt rarrow 4 4 mt 13 r 6 u 13 l 17 7 mt 3 r circ1 19.3 7 mt rarrow 14 11 mt 2.5 u circ1 14 3 mt 2 d circ1 4 4 mt rarrow 4 10 mt rarrow 13 4 mt rarrow 13 10 mt rarrow 14 3 mt uarrow 14 12 mt darrow 17 6 mt uarrow 17 9 mt darrow font1 black 0 setgray newpath 4 2 ((|j|6\152|6\260|1|j)\nphase\nshift) box46 4 8 ((|j|6\152|1|j+|j90|6\260|1|j)\nphase\nshift) box46 newpath 14 4 multi 14 10 multi 17 7 adder font1 14 15.3 (quadrature\ncarrier in) cc 14 -0.5 (in-phase\ncarrier in) cc 22 7.15 (SSB\noutput) cc -2.2 7.1 (audio\ninput) cc end ypos snap2 restore /ypos exch def } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /figure3 { % name of textfile: muse.fig.121.3 Allpass phase shift network % ............................ save /snap3 exch def systemdict /setstrokeadjust known {true setstrokeadjust} if electronics begin 25 5 10 setgrid % 30 25 showgrid /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse }{ pop} ifelse setgray} def /green {0.33 settint} def /cstretch 0.02 def /sstretch 0.0 def /kern 0.1 def /yinc 1.1 def /font0 /Helvetica-Bold 1.2 gonzofont /font1 /Helvetica 0.85 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 /opamp {gsave translate save /opsnap exch store 0.33 setgray1 0 -2.5 mt 5 2.5 rlineto -5 2.5 rlineto closepath gsave grayshade 0.15 sub setgray fill grestore 1 setlinecap line2 stroke /font1 /Helvetica-Bold 1 gonzofont font1 0.6 1.2 (\261) cc 0.7 -1.7 (+) cc opsnap restore grestore} def /semilogblock {gsave translate 0 0 mt 10 pu 10 pr 10 pd 10 pl grayshade setgray1 fill 0.33 setgray1 1 1 10 {log 10 mul 0 moveto 0 10 rlineto stroke} for 0 1 10 {0 exch moveto 10 0 rlineto stroke} for grestore } def /allpassplot {gsave translate beige line1 beige 0.33 setgray1 0 0 semilogblock 10 0 semilogblock 10 0 translate 1 setlinejoin 1 setlinecap 0.33 setgray1 line3 -10 0 mt 10 u 20 r 10 d 20 l -10 0 mt 0.5 d 0 0 mt 0.5 d 10.5 u 10 0 mt 0.5 d -10 0 mt 0.5 l -10 5 mt 0.5 l 20.5 r -10 10 mt 0.5 l newpath green 0.33 setgray1 .11 dup log 10 mul exch 1 exch atan 9 div 10 exch sub moveto .11 .1 9.1 {dup /posn exch store 1 exch atan /tval exch store posn log 10 mul tval 9 div 10 exch sub lineto } for line3 stroke /yinc 0.8 def black font1 -10 -1.5 (0.1) cc 0 -1.5 (1.0) cc 10 -1.5 (10.0) cc 0 -2.7 (frequency in kiloHertz) cc -11 -0.3 (-180) cr -11 4.7 (-90) cr -11 9.7 (0) cr -15 5.5 (phase\nangle\nin degrees) cc grestore } def 2 15.5 translate 5.5 -11.5 allpassplot /allpasscircuit {gsave translate beige line1 5 0 mt 2.5 r circ1 6 0 mt dot 6 0 mt 4 u 7 l 2.5 d dot 2.5 4 hresistor 0 1.5 mt 6 l 0 -1.5 mt 6 l 3 u 1.5 d 1.5 l circ1 -6 0 mt dot -3.5 1.5 hresistor -3.5 -1.5 hcap -1 -1.5 mt dot -1 -1.5 mt 4 d ground -1 -3.3 vresistor 0 0 opamp grestore} def %%%% start ckt 15 6 gsave translate 0.9 dup scale 0 0 allpasscircuit grestore font1 black 2 0 translate 15.5 10.7 (10K) cc 21.3 5.7 (out) cl 4.7 5.7 (in) cr 9.5 8.3 (10K) cc 13 1.7 (10K) cl 9.5 2.7 (0.016|j|6m|1F) cc end ypos snap3 restore /ypos exch def } def % /figure3 {} def %%%% /figure4 { save /snap4 exch def % name of textfile: muse.fig.122.4 Quadrature network generation % ............................ save /snap4 exch def systemdict /setstrokeadjust known {true setstrokeadjust} if electronics begin 35 10 10 setgrid % 30 55 showgrid /setgray1 { dup grayshade 1 eq { 0.5 gt {pop 1}{pop 0} ifelse } {pop}ifelse setgray } def /green {0.33 settint} def /cstretch 0.02 def /sstretch 0.0 def /kern 0.1 def /yinc 1.1 def /font0 /Helvetica-Bold 1.2 gonzofont /font1 /Helvetica 0.85 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 /yinc 0.8 def % redefs for intentional grayshade background /circ1 {gsave currentpoint newpath 0.20 0 360 arc % whitefill gsave grayshade setgray1 fill grestore line1 stroke grestore} def %for circle /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 /cap {currentpoint 2 copy gsave grayshade setgray1 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 /opamp {gsave translate save /opsnap exch store 0.33 setgray1 0 -2.5 mt 5 2.5 rlineto -5 2.5 rlineto closepath gsave grayshade 0.15 sub setgray1 fill grestore 1 setlinecap line2 stroke /font1 /Helvetica-Bold 1 gonzofont font1 0.6 1.2 (\261) cc 0.7 -1.7 (+) cc opsnap restore grestore} def /allpasscircuitx {gsave translate beige line1 5 0 mt 1 r 6 0 mt dot 6 0 mt 4 u 7 l 2.5 d dot 2.5 4 hresistor 0 1.5 mt 5 l 0 -1.5 mt 5 l 3 u 1.5 d 1 l -5 0 mt dot -3 1.5 hresistor -3 -1.5 hcap -1 -1.5 mt dot -1 -1.5 mt 3.5 d ground -1 -3.3 vresistor 0 0 opamp grestore} def %%%% start ckt /phasea {gsave translate 5 5 allpasscircuitx 17 5 allpasscircuitx 29 5 allpasscircuitx 5 16 allpasscircuitx 17 16 allpasscircuitx 29 16 allpasscircuitx line1 -1 5 mt 11 u 5.5 d 1.5 l circ1 35 5 mt 1.5 r circ1 35 16 mt 1.5 r circ1 font1 black /yinc 0.8 def [{2 7.2 (10K) cc} 12 3] xrpt [{2 7.2 11 add (10K) cc} 12 3 ] xrpt [{7.5 9.7 (10K) cc} 12 3] xrpt [{7.5 9.7 11 add (10K) cc} 12 3 ] xrpt [ {2 1.7 (2200\npf) cc} 12 3] xrpt [{2 1.7 11 add (2200\npf) cc} 12 3 ] xrpt 5 1 (2.124|jK) cl 5 12 add 1 (16.57|jK) cl 5 24 add 1 (192.1|jK) cl 5 1 11 add (520.1|j|6W|1) cl 5 12 add 1 11 add (6.034|jK) cl 5 24 add 1 11 add (47.06|jK) cl -4.7 10.7 (audio\ninput) cc 37 3.5 (in-phase\noutput) cc 37 14.5 (quadrature\noutput) cc grestore} def /rc {gsave translate line1 0 0 mt 3 r 1.5 0 hresistor 3 0 mt dot 3 0 mt -135 rotate 3 1.414 mul r 0 1.5 1.414 mul hcap grestore} def /asymb {gsave translate line1 [{5 5 rc} 3 6] xrpt [{5 8 rc} 3 6] xrpt [{5 11 rc} 3 6] xrpt [{5 14 rc} 3 6] xrpt [{5 2 mt -135 rotate rarrow} 3 6] xrpt [{23 5 mt 1.5 r circ1}3 4] yrpt [{5 5 mt dot} 3 4] yrpt 5 5 mt 1 l 3 u 1 r 5 11 mt 1 l 3 u 1 r 4 6.5 mt dot 4 6.5 mt 1.5 l circ1 4 12.5 mt dot 4 12.5 mt 1.5 l circ1 456 font1 black 26.5 5.1 (270|6\260|1\noutput) cc 26.5 5.1 3 add (180|6\260|1\noutput) cc 26.5 5.1 6 add (90|6\260|1\noutput) cc 26.5 5.1 9 add (0|6\260|1\noutput) cc 0.5 6.7 ((-)\ninput) cc 0.5 12.7 ((+)\ninput) cc 4 1.5 (a) cc 7 1.5 (b) cc 10 1.5 (c) cc 13 1.5 (d) cc 16 1.5 (e) cc 19 1.5 (f) cc 5 14.5 (a) cc 8 14.5 (b) cc 11 14.5 (c) cc 14 14.5 (d) cc 17 14.5 (e) cc 20 14.5 (f) cc font4 22 2 (all resistors 10K) cl font4 /yinc 0.9 def 6.5 16.7 (.0976\n|6m|4F) cc 6.5 3 add 16.7 (.0566\n|6m|4F) cc 6.5 6 add 16.7 (.0265\n|6m|4F) cc 6.5 9 add 16.7 (.0119\n|6m|4F) cc 6.5 12 add 16.7 (.00555\n|6m|4F) cc 6.5 15 add 16.7 (.00321\n|6m|4F) cc grestore} def /box46 {gsave /msg exch store translate beige line2 0 0 mt 4 pu 6 pr 4 pd closepath gsave grayshade 0.15 sub setgray1 fill grestore 0.33 setgray1 stroke black font1 3 2.6 msg cc grestore} def %%%% start figure A /parta {gsave translate 0 0 mt 15 pu 26 pr 15 pd closepath gsave beige grayshade setgray1 fill grestore line2 0.33 setgray1 line3 stroke black font1 13 1 ((A) Analog phase difference method.) cc gsave 4.7 3 translate 0.5 dup scale 0 0 phasea grestore grestore} def /hilbert {gsave translate /yinc 0.9 def line1 5 12 mt 2 l circ1 5 12 mt 17 r circ1 12.5 12 mt dot 12.5 12 mt 5.5 d 9.5 r circ1 5 10 (\n|hA/D\nconverter) box46 14 10 (Hilbert\ntransformer\nH{t}) box46 14 4.5 (Delay\nequalizer\nf{t}) box46 font1 24 6.7 5.5 add (90|6\260|1\noutput) cc 24 6.7 (0|6\260|1\noutput) cc 1 12.3 (|1analog\ninput) cc grestore} def %%%% start figure B /partb {gsave translate 0 0 mt 17 pu 26 pr 17 pd closepath gsave beige grayshade setgray1 fill grestore 0.33 setgray1 line3 stroke black font1 13 1 ((B) Analog asymmetric polyphase method.) cc gsave 2 1.5 translate 0.8 dup scale 0 0 asymb grestore grestore} def %%%% start figure C /partc {gsave translate 0 0 mt 15 pu 26 pr 15 pd closepath gsave beige grayshade setgray1 fill grestore 0.33 setgray1 line3 stroke black font1 13 1 ((C) Digital using Hilbert transform.) cc gsave 2 0 translate 0.85 dup scale 0 0 hilbert grestore grestore} def 1 1 partc 1 17.5 partb 1 36 parta % 0 0 hilbert end ypos snap4 restore /ypos exch def } def %%%%%% /figure5 { % name of textfile: muse.fig.116.5 HTML error codes % ............................ save /snap1 exch def %%%%%%%%%%%%%%%%%%% electronics begin bestgray bl 5 add bb 5 add 10 setgrid % 16 35 showgrid /cstretch 0.02 def /sstretch 0.0 def /kern 0.1 def /yinc 1.1 def /font0 /Helvetica-Bold [1.2 0 0 1 0 -0.2] gonzofont /font1 /Helvetica 0.75 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 font1 end ypos snap1 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|2Bacon's TV Directory|1 % 332 S Michigan Ave % Chicago IL 60604 % (312) 922-2400 % |Z % %% special biblio format this month /font3 /Helvetica-Oblique [9 0 0 9 0 0] gonzofont /txtwide 510 def xpos 16 sub ypos /tabs [-18] def (|t|1Albersheim and Shirley, |2Computation Methods for \ Broad-Band 90 degree Phase Difference Networks,|1 IEEE \ Transactions on Circuit Theory, May 1969, page 180. |h |1|tBedrosian, S.D., |2Normalized Design of 90 Degree \ Phase-Difference Networks|1, IRE Transactions on Circuit \ Theory, June 1960, page 128. |h |1|tDarlington, Sidney, |2Realization of a Constant Phase \ Difference|1, Bell System Technical Journal, January 1950, \ page 94. |h |1|tDiethelm, Kai, |2A Method for the Practical Evaluation of \ the Hilbert Transform|1, \ |/surl www.informatik.uni-hildesheim.de|/matik |h |1|tGingell, M. J., |2Single Sideband Modulation using \ Sequence Asymetric Polyphase Networks, |1Electrical \ Communication, 1973 volume 48, nos 1 & 2, pp 21-25. |h |1|tHawker, Pat, |2Technical Topics Scrapbook|1, Radio Society \ of Great Britian, 1993. |h |1|tHorowitz and Hill, |2The Art of Electronics|1, Cambridge \ University Press, 1989, page 5.16. |h |1|tJackson, Leland B., |2Digital Filters and Signal \ Processing|1, Kluwer Pub, 1989. |h |1|tLancaster, Don, |2Active Filter Cookbook|1, Synergetics \ Press, 1995. |h |1|tMikhael, Wasfy B, |2Sequence Discriminators and their use \ in Frequency Division Multiplex|1, IEEE Transactions on \ Circuits and Systems, February, 1979. |h |t|1O'Meara, T.R., |2The Synthesis of "Bandpass" Allpass \ Time Delay Networks with Graphical Approximation \ Techniques|1. Hughes Research Laboratories Technical \ Reports #114 and #159, September 1960. |h |t|1Orchard, |2Synthesis of Wideband Two-Phase Networks|1, \ Wireless Engineer, March 1950, page 72. |h |1|tSaraga, W., |2Design of Wide-Band Phase Splitting \ Networks|1, Proceedings of the IRE, July 1950 page 754. |h |t|1Schmidt, |2Phase-Shift Network Analysis and Optimization|1, \ QEX, April 1994. |h |1|tSekey, Andrew, |2Digital Signal Processing|1, IEEE Press, \ 1975. |h |t|1Snyder, Richard V, |2A new Broad-Band multiport \ Differential Phase Shift Network|1, Proc IEEE, Aug 1971. |h |1|tWinder, Steve, |2Filter Design|1, Newnes Publishing, \ 1997, Chapeter 9. |h |1|tYoshida, Tetsuo, |2Polyphase Network Calculation using a \ Vector Analysis Method|1, QEX, June 1995. ) 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|2AKM Semiconductor|1 2001 Gateway Pl 650 W San Jose CA 95110 (888) 256-7364 |Z |2Atmel|1 2325 Orchard Pkwy San Jose CA 95131 (408) 441-0311 |Z |2Compu-Mart|1 899 Presidential #110 Richardson TX 75081 (972) 238-1133 |Z |2Computer Reseller|1 600 Community Dr Manhasset NY 11030 (516) 562-5000 |Z |2Earth Observer Monthly|1 13741 E Rice Place #200 Aurora CO 80015 (303) 690-2242 |Z |2Hewlett-Packard|1 PO Box 10301 Palo Alto CA 94303 (415) 857-1501 |Z |a |2Intl Power Institute|1 10210 Leatherleaf Ct Manassas VA 22111 (703) 257-1415 |Z |/surl |2Lindsay Publications|1|/lindsay PO Box 538 Bradley IL 60915 (815) 935-5353 |Z |2Raychem|1 300 Constitution Drive Menlo Park CA 94025 (800) 227-7040 |Z |2Tom Oliver & Associates|1 PO Box 999 Dewey AZ 86327 (520) 632-8774 |Z |/surl |2Synergetics|1|/synlib01 Box 809 Thatcher AZ 85552 (520) 428-4073 |Z |2Texas Instruments|1 PO Box 809066 Dallas TX 75380 (800) 336-5236 |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 QUADRATURE WAVEFORMS are mechanically or \ electrically shifted by precisely 90 degrees from each other. \ They have many uses.)def /f2name (Fig. 2 \261 ONE POPULAR METHOD of single sideband \ generation uses a broadband audio quadrature phase \ shifter.) def /f3name (Fig. 3 \261 FIRST ORDER ALLPASS active filter can be \ used as an equalizer, cranking out phase as fast as some other \ circuit cranks it in.) def /f4name (Fig. 4 \261 THREE APPROACHES to broadband quadrature \ phase shifting) def /ad1name ( ) def % dummy /s1name (BROADBAND QUADRATURE RESOURCES) 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 setgray % 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$75.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$75.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 /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 /quest2 {(http://www.tinaja.com/psutils/fourier.ps) eurl} def /impi {(http://www.impiweb.org) eurl} def /matik {(http://www.informatik.uni-hildesheim.de/~diethelm/abstracts/hil-tra.html) 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 /resbn73 /elesimp /dontsick /muse117 /bannyear /trimode /syncat01 /muse105 /muse107 /alphadem /resbn72 /infopack /bustpat /resbn66 ] {setglib} forall [ /magsn01 /patnt01 /ismm01 /ismm01 /libry01 /blat01 /advt01 /barg01 /amlink01 /post01 /bod01 /scweb01 /tinaja01 /synlib01 /info01 /picup01 /webwb01 /golly01 /santa01 /acrob01 /hack01 /weblib01 /pseudo01 /info01 /beewb01 ] {sethtml} forall [ /parallaxinc /lindsay /bh /amazon /hotbot /discoverypark /keelynet /homepower /epri /rmi /mgfx /newtek /maxim-ic /tinaja /questlink /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 44 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 /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 /Times-Roman [7 0 0 7.1 0 5] gonzofont % factor superscript /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 M |b ost science students should quickly learn this essential rule: \ |2An hour spent in the library is worth a month in the lab|1. \ Same goes for engineers.|p There's not much point in \ doing any personal labwork or any product development when someone \ else has long ago clearly created something much better. Or \ has found all of the hidden insider gotchas that are \ flat out gonna prevent you from getting where you think you \ are headed. Let's look at a topic that starts off a lot more library \ than lab\274 |c Understanding Quadrature |d I've often been accused of heading off at right angles \ to everyone else. Turns out there often is a darn good \ reason for doing so. Take a bicycle wheel. Tie a ribbon on its rim. Spin \ it on a north-south axis per figure one. When viewed "axle-on" from the south, you will see the \ ribbon going round and round. Spending time east and \ west of the axle and time up and down from the axle. When viewed from the west, you should see a ribbon \ bouncing up and down. Rapidly changing in mid path, but \ spending "dwell time" near its upper and lower travel \ limits. The west-viewed waveform traced out by the ribbon is often \ called a |2sinusoid|1 or simply a |2sinewave|1. Now view the wheel from the top. You'll now see the \ ribbon bouncing back and forth, but this is different \ somehow. Yeah, this is still sort of a sinewave. Although this \ particular "sinewave" responds to the east and west \ ribbon motion rather than the up and down motions of the \ previous one. By itself, the shape does seem sinusoidal. \ But compared to the up and down viewing, we have a \ |2cosine|1. Such a cosine wave will be |2phase shifted|1 by precisely \ |490|1 degrees from its sinewave counterpart. Note particularly that the side view |2ignores|1 any and \ all back and forth ribbon motion, while your top view \ will ignore any and all up and down ribbon motion. |1The \ info content on the one channel is invisible to \ that of the other!|1 The two waveforms are said to be either |2orthogonal|1 \ or in |2quadrature|1. Quadrature waveforms do occur over \ and over again in electronics. Ferinstance, your ribbon position could define a |2vector|1 \ from your axle, expressed in |2polar coordinates|1. Our \ vector has a |2length|1 and a |2direction|1. In \ a |2math space|1, your angle will be in degrees \ |2counterclockwise from east|1. Alternately, in \ a |2geographical space|1, the degrees are |2clockwise from \ north|1. Obviously, you should pick one or the other and \ stick with it. Electronic stuff almost always uses math space \ degrees. The west-view sinewave and the top-view cosine wave \ instead define your ribbon position with two |2scalar|1 \ quantities, or a pair of |2single|1 values. Often, \ quadrature measurements or waveforms can get used to \ |2convert between a vector and its two scalar \ components|1. Such separated parts are said to be \ in |2rectangular|1 or |2Cartesian|1 coordinates. Say you have a twenty inch bike wheel with a ten inch \ radius. Say the ribbon happens to slant |4+60|1 degrees \ in math space. The top viewed east to west or cosine \ component should be |4+5.0|1 inches, because the \ trig cosine of sixty degrees is |40.5000|1. The \ side viewed up-down or sine component will be |4+8.660|1 \ inches, because the trigonometric sine of sixty degrees \ is calculated as |40.8660|1. Such trig values are easily found in math tables, in \ scientific calculators, and even slide rules. They \ also may be created by a series approximation \ algorithm or whatever. The side or sine view is sometimes called the |2real|1 \ or the |4I|1 or the |2inphase|1 component; the top or \ cosine view is sometimes called the |2imaginary|1 or the \ |4Q|1 or the |2quadrature|1 component. The letter |2j|1 \ is often used to denote an electronic imaginary axis. \ Seems that current had first dibs on the more obvious \ |2i|1 variable. |c Neat Quadrature Tricks |d One remarkable property is that all quadrature channels of \ information can be |2independent|1 of each other. If you \ try multiplying any sine times a cosine over precisely one \ cycle, you will get a zero result. This happens \ because your cross products change for each quadrant. \ Algebraic |2signs|1 are both positive in quadrant |4I|1 \ and are both negative in quadrant |4III|1. But they are \ opposites in quadrants |4II|1 and |4IV|1. Yet another group of remarkable properties is that the \ |2slope|1 for any cosine is a quadrature sinewave! And \ the |2slope|1 of a sinewave is a |2negative|1 quadrature \ cosine wave. A different name for "slope" is the \ |2derivative|1. Further, the |2accumulated area|1 you should find under any sinewave is a \ quadrature cosine wave. And your accumulated area under the \ cosine wave is a negative quadrature cosine. Another \ name for "accumulated area" or any "area under the curve" is \ the mathematical |2integral|1. As with trig values, \ integrals and derivatives are found in books of \ math tables. Or can be generated by finding \ slopes or by adding up cumulative areas. See any intro calculus book for all the gory details. In fact, you could build a dandy oscillator simply by \ cascading two integrators and a sign changer. This \ "solves" the fundamental |2differential equation|1 \ relating sines and cosines, and thus simply |2has|1 to \ create them. Such an oscillator can simultaneously \ provide you with a pair of quadrature sine and cosine \ wave outputs. A lossy variation on cascaded sine and cosine integrators is \ known as a |2state variable active filter|1. Which can \ offer you a stable high |4Q|1. One obscure use for these \ is |2quadrature art|1 where psychedelic audio color patterns \ could get displayed on an oscilloscope or a computer screen. More \ details on state variable filters and quadrature art aps \ in my |/surl |2Active|/synlib01 |/surl Filter Cookbook|1|/synlib01 . Although the sine values and the cosine values can end up \ completely independent of each other, together they should \ define a unique ribbon position or |2phase|1 on the \ wheel. This suggests that we can place two totally \ different channels of information on a rotating vector \ or a similar |2carrier|1. Which lets us put twice as \ much stuff in a given bandwidth than we might have \ thought we could. These channels might be called an |4"I"|1 (for in phase) and \ the |4"Q"|1 (for quadrature) channel. They become quite \ important in cellular comm and wireless modems. One \ older example of |4I|1 and |4Q|1 channel use is color tv \ where the chroma info is set by a pair of |2color \ difference|1 values. |c Generating Quadrature Signals |d One really big use for quadrature signals can involve \ |2single sideband communications|1. Figure two shows us \ how a broadband quadrature phase shift network can be \ used to create |4SSB|1 transmissions. For |4SSB|1 gives us \ compelling advantages over earlier |4AM|1 or |2amplitude \ modulation|1. In that only half your bandwidth is needed \ and no raw carrier power has to get transmitted or wasted. Generating a quadrature signal at a single frequency is \ no big deal. We have seen that changing a physical \ point of view by |490|1 degrees does it. You also can \ simply stall or |2delay|1 for a quarter cycle. Ferinstance, a one kiloHertz audio sinewave has a time \ period of one millisecond. Any old |2fixed|1 delay of a \ quarter millisecond should to it. At |4100|1 MHz, a \ quarter wavelength or |490|1 degrees will be slightly over \ two feet. Thus, the time delay from any short piece of \ coax or other line can get used as a single-frequency \ quadrature phase shifter. There even used to be \ |2trombone lines|1 found in |4VHF|1 phase shifting lab \ work. For useful |4SSB|1 or modem comm, though, \ you will need to quadrature delay a |2band|1 of \ frequencies. Sadly, what was your |490|1 degree fixed delay \ phase shift at 1000 Hz becomes a |4135|1 degree phase \ shift at |41500|1 Hertz and a |4180|1 degree phase shift \ up at |42000|1 Hertz. Instead, you will want some |2linear \ phase|1 system which advances phase exactly by |490|1 \ degrees as you advance your frequency. Nearly any analog lowpass circuit using either \ capacitors or inductors inherently |2has|1 to provide \ more delay than a linear phase. For the simple reason that \ capacitors and inductors are |2causal|1, meaning that \ they can "remember" what went on in the past but have no means \ of foretelling the future. Thus, higher frequency parts \ of waveforms tend to get further and further behind. This is known as the |2group delay problem|1, and is it \ ever. Ferinstance, if the ones of an older modem were at one \ frequency and the zeros were at another, with bad group \ delay in a filter, you will get times when you have a one, \ a zero, |2neither|1, or |2both|1 at the output! Obviously "neither" or "both" are highly ungood. So, you'll have to get real fancy if you decide to build up a \ wideband quadrature network. In fact, it turns out there \ is no perfect way known to do so. Amplitude or phase \ lumps are certain. As is limited bandwidth. But three useful approaches appear if you peek ahead to \ figure four. But first, let's pick up some details on a \ circuit we may find useful\274 |c An Allpass Equalizer |d To work around all of the inherent excess phase shifting \ problems with traditional inductors and capacitors, an \ |2equalizer|1 can sometimes be used. An equalizer is \ simply a circuit that tries to crank out excess phase as \ fast as the problem circuit cranks it in. A simple first order |2allpass|1 section and its \ response appears in figure three. This circuit has the \ property that all reasonable frequencies will be passed with \ equal unity gain. To analyze this circuit, note that the gain of the opamp \ will be |4-1|1 to an input on your left side of that left \ resistor on the inverting (-) input; and |4+2|1 to a \ signal applied directly to the non-inverting (+) input. At the lowest of frequencies, the capacitor will seem nearly an \ open circuit, and the gain will be -1, for a phase \ |2advance|1 of |4180|1 degrees. At very high \ frequencies, the capacitor will be nearly a short \ circuit, and the gain will be -1 + 2 = +1 for a phase \ shift of |40|1 degrees. Whenever your capacitive reactance \ matches your resistance, the combined phase shifts and \ gains on the op amp inputs will still give you a unity \ gain output, but at a phase advance of |490|1 \ degrees. Thus, unlike any typical lowpass filter circuit, phase \ gets |2retarded|1 as frequency increases. This \ retardation can be used to offset excess phase in \ whatever your new allpass equalizer is trying to equalize. You can also have fancier |2second order|1 equalizer \ circuits that let you crank phase in and out faster with \ more control. Higher order allpass networks are also \ possible, but they are usually done using cascades of \ first order and second order allpass sections grouped together. |c Broadband Quadrature Networks |d How can you generate a broadband quadrature phase \ shift? Returning to figure four, our first scheme is called the \ |2phase difference method|1. In which you'll set up two \ cascaded chains of first order allpass circuits. One for I, one for Q. By carefully specifying the phase advance of each circuit, \ you can get a |490|1 degree |2differential|1 delay \ between the two channels over a chosen wide bandwidth. These \ differential delays typically can be |4+45|1 degrees and \ |4-45|1 degrees with respect to the input. The amplitude \ is reasonably smooth, but there will be lumps in the \ phase. An original phase difference paper is by Bedrosian in \ the June 1960 |5IRE |2Transactions on Circuit Theory|1. The second route uses the |2phase sequence network|1. The fixed \ array of resistors and capacitors gets driven \ off of a differential pair of audio sources. And giving \ relative phases of |40|1, |490|1, |4180|1, and \ |4270|1 degrees. This phase sequence method is covered in \ |2The Art of Electronics|1. One original phase sequence \ paper is by Gingel and published in |2Electrical Communication|1, \ v48-1. Do note that these analog circuits only provide \ |2differential|1 |490|1 degree phase shifting. Both \ output channels will inherently be "behind" the real \ world in-phase channel because a capacitor can causally \ react only to events that have already happened. Digital filters do have a stunningly interesting \ property. They can look "forward" as well as "backward" \ in time. Simply by checking earlier or later taps in a \ time storage history. Thus, digital filters can be \ |2noncausal|1 and hence "distortionless". It's quite \ easy to build a linear phase, sharp cutoff digital \ filter. We did look at these techniques in \ |/surl |4MUSE105.PDF|1|/muse105 through |/surl |4MUSE107.PDF|1|/muse107 In fact, digital filters can easily do all sorts of \ things that are difficult or impossible with \ analog. There is a piece of black magic math known as a |2Hilbert \ Transform|1. Which simply tells us "phase shift everything \ by ninety degrees." Figure |44C|1 shows us the |2Hilbert \ Transform digital filter|1 approach to broadband \ quadrature phase generation. While the phase can end up \ exact, there will be modest amplitude ripple in your needed \ approximations. One useful ploy is the \ |2Ramez|1 algorithm. Hilbert transforms can get built up with all the usual adders, \ delays, and |4DSP|1 multipliers. One useful digital filter book that includes Hilbert \ Transform info is Jackson's |2Digital Filters and Signal \ Processing|1. I've gathered a few more detailed references on \ broadband quadrature networks together for you as this \ month's resouce sidebar. Loads of thanks to Winfield Hill \ and Rodger Rosenbaum for their inputs here. |c HP's ScanJet 6100C |d The nice developer people over at |/surl |2Hewlett Packard|1|/post01 loaned me one \ of their new |2ScanJet|1 |56100C|1 scanners to play \ with. While I haven't had it long enough yet for a complete \ review, I am |2very|1 impressed with what this beast can \ really do. This is a premium and legal sized flatbed scanner that \ interfaces with a |4PC|1 host through a fast |4SCSI|1 \ interface. List price is |4$921|1 for either the |4PC|1 \ or Mac version. Street prices should end up somewhere \ around the |4$620|1 range. Good pricing on |4HP|1 products often \ shows up in |2Computer Reseller|1 and |2Comp-U-Mart|1 \ magazines. This unit combines a fluorescent light with its |4CCD|1 \ charge coupled device line sensor. Optical resolution is \ |4600 DPI|1, with software deliverable resolutions \ ranging from |412|1 to |42550 DPI|1. Cropping is a snap \ and scaling can go from |43|1 to |4400|1 \ percent. Color or black and white is done in a wide variety of \ formats. Including a self-optimizing |410|1 bit gray and \ |424|1 bit full color. Fancy image processing options \ include dithering, filtering, thresholding, interpolation, \ a gamma adjustment, \ inversion, scaling, color correction, \ and mirroring. There is even an optional |435 MM|1 slide scanner accessory. My main interest in a scanner is to capture all of my \ older books for my web site and CD-ROM publishing \ ventures. The |4HP|1 scanner interfaces beautifully with \ |/surl Acrobat Capture|/acrob01 for extraction of |2both|1 the text |2and|1 \ the layout. Bee is going bonkers over this machine, \ scanning all sorts of stuff for textile teaching, crafts, \ and her co-op food newsletters. There's also a copier mode that sure is handy. This \ works with your laser printer and gives you all sorts of \ size, quantity, quality, shading, and enlargement \ options. Compared to a "real" copier, the |46100C|1 ends up \ somewhat slower using its highest quality mode. But \ normally makes for much better looking results. This is a really great machine. |c New Tech Lit |d From |2Texas Instruments|1, |4CDROM|1 platters on |2Logic|1 and \ |51394|2 Solutions|1. From |5AKM|2 Semiconductor|1, a new \ |2Audio & Multimedia Data Book|1. And from |2Raychem|1, the \ revised |2Circuit Protection Databook|1. From |2Atmel|1, their new |5AVR |2Risc Microcontroller|1 \ data book. Uh, when compared to the |4PIC|1, their |5AVR|1 seems \ to me to be cheaper and faster, but a lot less elegant. \ Their instruction set is very much |46502|1 like, (yea, \ team) but typically should execute in single machine cycles. \ Even their smallest units include a fast multiplier and an \ analog comparator. Both external and internal interrupts are \ supported. Landsat |4MSS|1 image data is newly available on |4CD \ ROM|1 by way of |2Tom Oliver|1. His prices start at |4$13|1 per \ |4CD|1. Broad coverage in several spectral bands is \ available. Amazingly cheap aerial photos with surprisingly \ high resolution are separately offered by several \ advertisers in |5EOM|1, short for |2Earth Observer \ Monthly|1. Info on microwave and RF heating ideas \ at the |2International Microwave Power Institute|1 at \ |/surl |2www.impiweb.org|1|/impi Bunches of worthwhile books this month. Start with |2Inside \ Intel|1, which to me shows how enough arrogance and lots \ of lawyers can force clearly inferior technology into \ an industry dominance. I don't care for either the title or \ the really awful fonts in |2Web Psychos, Stalkers, & \ Pranksters|1. But the book nicely reveals solid info on \ hiding and unhiding web addresses and steps you can take \ towards your own web security. For guidance on where the \ web seems to be taking us, read |2Growing Up Digital: \ The Rise of the Net Generation|1. Check out my \ |/surl |2www.tinaja.com/amlink01.html|1|/amlink01 for more details on \ these titles. Finally, from |/surl |2Lindsay|1|/lindsay , his latest new-old book on \ |5Popular Mechancics |51919|2 Shop Notes|1.|1 That \ hydraulic ram on page |42971|1 sure is a \ cute and "free" way to pump water uphill. A great and free master industry wide electronic search \ service is now up at |/surl |2www.questlink.com|1|/questlink While not obvious, PostScript can elegantly \ (though not instantly) get tricked into painting with \ translucent ink! Plus "alpha" channel overlay \ effects. Blue screens, even. Further details are in \ |/surl |4ALPHADEM.PDF|1|/alphadem on my |/surl |2www.tinaja.com|1|/post01 . Info on \ new wireless developments appears in |/surl |4RESBN72.PDF|1|/resbn72 , \ while the better and the more popular wireless books are \ listed for your review at |/surl |2www.tinaja.com/amlink01.html|1|/amlink01 . And \ more secrets of web research newly appear in \ |/surl |4INFOPACK.PDF|1|/infopack . For the fundamentals of starting up your own tech \ venture, check into my |/surl |2Incredible Secret Money Machine \ II|1|/ismm01 . From my nearby |/surl |2Synergetics|1|/synlib01 ad. Our new full \ color catalog is now freshly available online. A reminder that banner sponsors are welcomed for my \ |/surl |2Guru's Lair|1|/tinaja website. We've now "exceeded the speed \ of light" with way over |4186,384|1 hits per month, and \ are fast sneaking up on "going to the moon" at \ |4240,000|1. Total costs might end up under two cents per \ actual click through. Check |/surl |2www.tinaja.com/advt01.html|1|/advt01 . |/tinton |-F|1 |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 /font0 /StoneSans-Bold 1.4 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 348 225 sub menu8 %%%%%%%%%%%% end pdfmenu8 %%%%%%%%%%%% showpage % this optionally displays the figures /prodart false def prodart { /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 {0 50 2colwide f3h true true /f3name /figure3 stdmusefig} def % link /fig4x {40 20 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 /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 60 0 translate % huh? 1.5 dup scale {0 0 0.9 fig3x} exec showpage /narrowfig 0 def /grayshade 0.92 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 /urlx 50 def % temp? /urly 50 def /tinton1 {} def /tinton {} def /grayshade 1 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 60 0 translate 1.5 dup scale {0 0 0.9 fig3x} exec showpage /grayshade 1 def 1.5 dup scale {0 0 0.9 fig4x} exec showpage /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 % 50 120 menu8