%! % ========= % This file requires the previous download of gonzo.psl % available from https://www.tinaja.com/pssamp1.shtml % Make sure the following line agrees with your own gonzo.psl location (C:/Users/don/Desktop/gonzo/gonzo.psl) run % use internal gonzo % ========== gonzo begin ps.util.1 begin printerror nuisance begin %%% PostScript Tools %% Don Lancaster %% modified 3/89 by Marc Stewart %% these routines print a Point Ruler, a protractor, and a small grid. /pointrule{ %... gsave -30 220 translate -125 rotate % 2 tick /xstrt -776 def /vstrt 200 def /tick1 -6 def /pos xstrt def 436 {pos vstrt moveto 0 tick1 rlineto /pos pos 2 add def 0.20 setlinewidth stroke} repeat % 10 tick newpath /pos xstrt def /tick2 -12 def 88 {pos vstrt moveto 0 tick2 rlineto /pos pos 10 add def 0.20 setlinewidth stroke} repeat % 50 tick /pos xstrt def /tick3 -18 def 18 {pos vstrt moveto 0 tick3 rlineto /pos pos 50 add def 0.20 setlinewidth stroke} repeat % point numbers newpath /Helvetica findfont [ 12 0 0 13 0 0 ] makefont setfont /vstrt vstrt 32 sub def /xstrt xstrt 12 sub def xstrt vstrt moveto -688 168 moveto 1.66 0 (100 150 200 250 300 350\ 400 450 500 550 600 650 700 750\ 800 850) ashow -734 168 moveto 1.66 0 (50) ashow -780 168 moveto (0) show -465 146 moveto /Helvetica findfont [40 0 0 15 0 0 ] makefont setfont (POINT RULE) show newpath -776 135 moveto 870 0 rlineto 1 setlinewidth stroke grestore } def pointrule /protractor {save /snapp exch def %% protractor, MS %%% this routine prints a 360 degree protractor %% by Marc Stewart, 3/89 save /circsnap exch def % variables /Radius 150 def %% the radius of the circle /CrossHairRadius Radius .08 mul def %% the inner radius /TextPlus 5 def %% how far away the degree measures /MinorAngle 5 def %% slightly smaller line /MajorAngle 15 def %% this angle is printed /Astring 4 string def %% used to convert numbers to strings % Font /FontSize 12 def % procedures /Minors { gsave 0 MinorAngle 360 { CrossHairRadius 0 moveto Radius 0 lineto stroke MinorAngle rotate} for grestore } def /Helvetica-Narrow findfont [12 0 0 12 0 0] makefont setfont /PrintNum { Astring cvs dup stringwidth pop 2 div neg 0 rmoveto show 0 0 mt (\312) show } def %%\312 is degree symbol /Majors { gsave 0 MajorAngle 360 { CrossHairRadius 0 moveto Radius 0 lineto stroke Radius TextPlus add 0 moveto gsave dup 0 eq %% print the angle { 0 -4 rmoveto PrintNum } { dup 180 eq { 180 rotate (180) stringwidth pop 2 div neg -4 rmoveto PrintNum } { dup 180 lt { -90 rotate PrintNum } { dup 360 lt { 90 rotate 0 FontSize neg TextPlus add rmoveto 360 sub PrintNum } if } ifelse } ifelse } ifelse grestore MajorAngle rotate } for grestore} def /MakeCrossHair { newpath 4 {0 0 moveto CrossHairRadius 0 lineto stroke 90 rotate} repeat 4 { 1.5 setlinewidth CrossHairRadius 0 moveto Radius 0 lineto stroke 90 rotate} repeat } def /TheCircles { newpath 0 0 Radius 0 360 arc stroke %% make the circle 0 0 CrossHairRadius 0 360 arc stroke} def %% make the inner ring % script 180 600 translate 180 rotate 0 setlinewidth %% very small line MakeCrossHair 0 setlinewidth Minors 0.5 setlinewidth %% a little bigger Majors TheCircles circsnap restore snapp restore} def protractor /grid {save /snapg exch def %% fine black rubbergrid % 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. /quadpixel {transform 4 div round 4 mul itransform} def /setgrid {save /rubbersnap exch def quadpixel /size exch def quadpixel exch quadpixel exch translate size dup scale} def /drawlines {72 300 div lw mul size div setlinewidth /hposs 0 def #hlines gs div 1 add cvi {hposs 0 moveto 0 #vlines rlineto stroke /hposs hposs gs add def} repeat /vposs 0 def #vlines gs div 1 add cvi {0 vposs moveto #hlines 0 rlineto stroke /vposs vposs gs add def} repeat} def /showgrid{ seegrid {gsave /#vlines exch def /#hlines exch def 106 45 {pop pop 0} setscreen 0 setgray /gs 1 def /lw 1 def drawlines fat5 {/gs 5 def /lw 3 def drawlines} if fatter10 {/gs 10 def /lw 5 def drawlines} if grestore}if} def /fat5 true def /fatter10 true def /seegrid true def gsave 300 25 10 setgrid 30 30 showgrid grestore snapg restore} def grid /radius {save /snapr exch def gsave %%%% circle radius %% Marc Stewart, 3/89 %%590 500 translate %% working upside down 460 790 translate 180 rotate 0 setlinewidth 0 setlinecap 0 setgray /Astring 3 string def %% for printing numbers /Helvetica-Narrow findfont 9 scalefont setfont 0 50 moveto %% this draws a faint line where the curve 100 50 lineto %% starts 100 60 lineto stroke 100 -10 10 %% repeat 10 times { /Radius exch def %% this is the radius 100 Radius sub 25 moveto %% move to next location 100 50 Radius 180 90 arcn %% build the arc backwards gsave Radius Astring cvs 0 -4 rmoveto %% drop down a bit show %% print the radius at this point grestore stroke } for grestore snapr restore} def gsave 0 0 translate radius grestore /linewide {save /snapl exch def gsave %%% examples of line widths %% Marc Stewart, 3/89 140 250 translate 180 rotate %% work upside down 0 setlinewidth 0 setlinecap 0 setgray /Astring 5 string def %% for printing numbers /Helvetica-Narrow findfont 9 scalefont setfont /LineLength 100 def 0 1 10 { /Lwidth exch def %% the line width 0 10 Lwidth 19 mul sub moveto LineLength 0 rlineto gsave Lwidth Astring cvs 1 -4 rmoveto show Lwidth 0 eq { 2 9 rmoveto -90 rotate ( setlinewidth) show } if grestore Lwidth setlinewidth stroke } for grestore snapl restore} def gsave 0 0 translate linewide grestore /lineends {save /snaple exch def gsave %%%% line end stuff %% Marc Stewart, 3/89 272 25 translate 180 rotate /Astring 5 string def %% for printing numbers /Helvetica-Narrow findfont 9 scalefont setfont /LineLength 75 def /Spacing -40 def 0 1 2 { /Cap exch def 15 setlinewidth Cap setlinecap 0 setgray 0 Cap Spacing mul moveto LineLength 0 rlineto stroke %% put the black line down .5 setlinewidth 0 setlinecap 1 setgray 0 Cap Spacing mul moveto LineLength 0 rlineto gsave 0 setgray Cap Astring cvs 9 -4 rmoveto show Cap 0 eq {( setlinecap) show} if grestore stroke 0 Cap Spacing mul 1 0 360 arc fill LineLength Cap Spacing mul 1 0 360 arc fill } for grestore snaple restore} def gsave 0 0 translate lineends grestore /joints {save /snapj exch def gsave %%%% setlinejoin stuff %% marc stewart 3/89 580 400 translate 180 rotate %% work upside down /Astring 5 string def %% for printing numbers /Helvetica-Narrow findfont 9 scalefont setfont /Connect 50 def /Spacing -45 def 0 1 2 { /Join exch def Join setlinejoin 0 Join Spacing mul moveto Connect dup rlineto Connect dup neg rlineto 0 setgray 0 setlinecap 15 setlinewidth gsave Join Astring cvs 5 -5 rmoveto show Join 0 eq {( setlinejoin) show} if grestore stroke 0 Join Spacing mul moveto Connect dup rlineto Connect dup neg rlineto 1 setgray 0 setlinecap .5 setlinewidth stroke } for grestore snapj restore} def gsave 0 0 translate joints grestore showpage % eof