% name of textfile: P15 SuperTabs (DL/Synergetics Feb 91 v1.0) % ========= % 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 % ========== % supertab (or cst) for short is an enhancement to the Guru gonzo % justification routines that let you mix and match justification % modes and fonts in tabular data. For instance, your first column % could be left justified bold Helvetica. Your second column % can be centered Revue with extra kerning. Your third column could % be right justified dollars and cents, and so on. You can even have % multiple lines within each individual tab position, and ordinary % multiple-spaced data can be used as tab delimiters. % One MAJOR use is to convert arbitrary fixed pitch tables from ANY % source into fully justitied text. Quickly, invisibly and automatically. % The format is as follows: % % xpos ypos ( -col1- delim -col2- delim .... -coln- % -col1- delim -col2- delim .... -coln- % . . . . . . . . . . . . . . . . . % -col1- delim -col2- delim .... -coln- ) cst % A supertab list has to be created first, of form % % /stabs [ [ -xoffset1- {justmode1} {customproc1}] % [ -xoffset2- {justmode2} {customproc2}] % . . . . . . . . . . . . . . . . . . % [ -xoffsetn- {justmoden} {customproc2}] ] def % % % The xoffset value is how far over from the current xpos left margin % the justify action is to take place. Note that this is the LEFT edge % for left or fill justify, the CENTER for center justify, or the RIGHT % edge for right justify. % % The justmode value is the callout justification mode that is to be % used for the tabbed substring. Use cl = callout left, cc = callout % center, cr = callout right, cf = callout fill, etc. % % The customproc is anything you want done immediately before showing % the tab substring. The most common use would be changing a font as % in {font6}, etc. % % Any number of EXTRA spaces can exist between input tab entries if % the -cropleadingspaces- boolean shown below is true. % Note: For intentionally blank lines, be sure to include a few % spaces. If your -stabdelimiter- is two spaces, be sure to % ALWAYS have at least two spaces between columns and NEVER % double space within a column. % stabdelimiter decides when to move you over to the next column. % Popular values would be two or more spaces for dealing with % imported listings, or an actual [I] tab /stabdelimiter ( ) def % two spaces means to tab over % stabnewline decides when to move you down to the next row. % While a simple carriage return works well, something fancier is % needed if the individual tabs also have carriage returns in them. /stabnewline (\n) def % and a return means start next line % cropleadingspaces is handy whenever you are adapting preformatted % fixed pitch data to full proportional PostScript ... /cropleadingspaces false def % inactive as default % ytabadjust provides for extra room between lines on multiple % line tab entries when needed ... /ytabadjust 0 def % default % cst is the main callout supertab routine. It grabs a long string and % breaks that string down into individual tab elements and then formats % them. /cst {/cstabstring exch def /ypos exch def /xpos exch def mark {cstabstring stabnewline search {exch pop exch /cstabstring exch def dup length 1 le {pop} if} {dup length 0 le {pop} if exit} ifelse} loop] save /cstsnap exch def /cstline exch def 0 1 cstline length 1 sub {cstline exch get /cstchomp exch def mark {cstchomp stabdelimiter search {exch pop exch /cstchomp exch def dup length 0 le {pop} if} {dup length 1 le {pop} if exit} ifelse} loop] /cstlarray exch def 0 1 cstlarray length 1 sub { /posn exch def save /ctsnap exch def stabs dup length 1 sub dup posn ge {pop posn} if get 0 get xpos add ypos stabs posn get 2 get cvx exec cstlarray posn get spchomp stabs posn get 1 get cvx exec ctsnap restore} for /ypos ypos yinc sub ytabadjust sub def} for ypos cstsnap restore /ypos exch def} 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 exch dup length 2 index sub 3 -1 roll exch getinterval} if} def % //// demos - remove or alter before reuse. //// gonzo begin % turn on the gonzo justify gutility begin % turn on the utilities printerror % activate the error trapper nuisance begin % activate the nuisance dictionary /font0 /Helvetica-Bold 12 gonzofont 125 585 (|0Example 1 \261 left, center & right justify) cl % set your favorite gonzo fonts /font1 /Helvetica 9 gonzofont /font2 /Helvetica-BoldOblique 9 gonzofont /font3 /Helvetica-Bold 9 gonzofont % this first demo combines left, center and right justifications... /stabs % create a supertab dictionary. each [ % element of form [0 {cl} {font1}] % [ -xpos- {justmode} {otherstuff} ] [140 {cc} {font2}] [250 {cr} {font3}] ] def /stabdelimiter ( ) def % marker to move to next tab position /stabnewline (\n) def % marker to move to next line /cropleadingspaces true def % get rid of leading spaces? % The data below is of form xpos ypos (tabbed data) cst. Be sure % to use several spaces on any intentionally blank lines and to % provide a minimum of TWO spaces between columns... 200 550 ( Aaron A Aardvark member $123.45 Boyd B. Bismark associate $92384.22 Clarence C. Calhoun director $5.83 Doyle D. Dogg student $29.86) cst % this second demo shows how to use multi row tabular callouts ... gsave 100 100 translate 25 250 (|0Example 2 \261 multi row tabular callouts) cl 85 110 330 111 4 roundbox % define a rounded bordder 2 setlinewidth stroke % and draw it 0.5 setlinewidth % add a double hairline 0 92 mt 330 r 0 94 mt 330 r /stabs % define your supertabs array [ [0 {cl} {font1}] [150 {cc} {font2}] [300 {cr} {font3 /yinc 15 def }] % proc can do all sorts of stuff ] def /stabdelimiter ($$\n) def % goes between entries /stabnewline (!!\n) def % goes between lines /cropleadingspaces true def % get rid of leading spaces /ytabadjust 30 def % extra spacing adjust 15 75 (This first multiple line |3submessage|1 is flush left and font1 $$ centered stuff #1 $$ Right #1 has been spaced wierdly !! This second multiple line |3submessage|1 is flush left and font1 $$ centered stuff #2 $$ Right #2 has been spaced wierdly)cst % This one shows you how to center all of the data in all of the % columns and gives you one way to handle any headers ... /stabs [ [30 {cc} {}] [150 {cc} {}] [260 {cc} {}] ] def /stabdelimiter ( ) def /stabnewline (\n) def font1 15 98 (WHOOPIE GOLLY WOWIEGEE) cst grestore % get out of the rounded box showpage % eof