%!PS %! % SigForth Director's Cut version 2.01 % ============================================================== % Copyright c 2017 by Don Lancaster & Synergetics, Box 809, Thatcher, AZ, 85552 % (928) 428-4073 Email: don@tinaja.com Website: http://www.tinaja.com % Consulting services available http://www.tinaja.com/info01.html % Linking welcome. Reposting expressly forbidden. % All commercial rights and all electronic media rights ~fully~ reserved. % Linking usually welcome. Reposting expressly forbidden. Version 1.1 % Gonzo utilities of http://www.tinaja.com/gonzo.psl are presently NOT % built in for immediate use. This adds 90K to the file size. A tutorial % can be found at http://www.tinaja.com/glib/gonzotut.pdf % If, instead, Gonzo is to be run as a diskfile for the much shorter code here, % Distiller MUST be run from the command line as this or similar % run //acrodist /F % Projects at http://www.tinaja.com/pssamp1.shtml % ======= %%%%%%%%%% % This code is needed for the automatic url placer %%%%%%%%%% % Requires a defined name for the url below % Activate with text text |/surl urlname |/eurl text text % /surl "start url" marks the beginning of a text sequence to be urled. % It also paints the text blue... /surl {mark /blue cvx 0.33 /setgray cvx % change text to blue /currentpoint cvx % remember box start /urly /exch cvx /store cvx /urlx /exch cvx /store cvx ] cvx % complete deferred command printlist exch 3 index exch put % stuff into gonzo printlist exch 1 add exch % increment gonzo list count } def % /eurl "end url" unmarks the end of a text sequence and sets up % the pdfmark needed to define the Acrobat web link. /eurl {mark % start deferred proc exch % position url string % /black cvx 0 /setgray cvx % turn blue marker off % maintextcolor /setrgbcolor cvx % reset to main text color??? /aqua cvx /black cvx /makeurl cvx % defer call of url builder ] cvx % complete deferred proc printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch % increment gonzo list count } def % /makeurl generates the pdfmark, receiving a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /urlover 0.2 def % fraction of hot area over bounds /makeurl { /cururlname exch store % save the url string mark % start pdfmark currentfont /ScaleMatrix get 3 get /fsize exch store % guess height /Rect [ urlx fsize urlover mul sub % set box left x urly fsize urlover mul sub % set box left y currentpoint exch fsize urlover mul add exch fsize add ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def % /makeurlx generates the box specific pdfmark, receiving % a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /makeurlx { /cururlnamex exch store % save the url string mark % start pdfmark /Rect [ xpos % set box left x ypos 0.9 sub % set box left y xpos 2.8 add % box right x ypos 0.9 sub 2.8 add % box right y ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def %%%%%%%%%%% % These code snippets do various things %%%%%%%%%%% /tinton1 {mark 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tintoff {mark 0 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /to {tinton1 aqua font6} store /tx {tintoff black font1} store /su {surl} store /webtintmat [ 0 1 5 {/a exch store 0 1 5 % webtint color array {/b exch store 0 1 5 {5 div b 5 div a 5 div} for }for } for ] def /setwebtint { abs cvi 216 cvi mod webtintmat % set 215 colors exch 3 mul 3 getinterval aload pop setrgbcolor} def /makered { mark 5 /setwebtint cvx ] cvx printlist exch 3 index exch put exch 1 add exch } store /makeblack { mark 0 /setwebtint cvx ] cvx printlist exch 3 index exch put exch 1 add exch } store %%%%%%%%%%%%%%%%%%%%%%%%%%%% /setpagefonts { /cstretch 0.015 def /sstretch 0.015 def /font0 /StoneSans-Bold 1.6 gonzofont /font1 /StoneSans 1 gonzofont /font2 /StoneSans [0.95 0 0.25 0.95 0 0 ] gonzofont /font4 /StoneSans 0.85 gonzofont /font3 /StoneSans-Bold 0.85 gonzofont /font6 /StoneSans-Bold 0.85 gonzofont /font7 /StoneSans-Bold 1.05 gonzofont % subheaders /font8 /StoneSans-Bold [0.65 0 0 0.65 0 0.4] gonzofont /font9 /StoneSans-Bold 1.05 gonzofont /txtwide 36 store /yinc 1.2 store /kern 0.1 store /texttop 51 store /textleft 3 store /amacro {(zy0) stringmacro /ypos ypos ypara add def} def % start drop cap /bmacro {(iFy1) stringmacro /ypos ypos ypara add def} def % finish drop cap } store %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /jpegimageprocwithlink { % hoffset voffset scale hres vres urlfrom urlto save /snap2 exch def /inurllink exch store % grab link filename /infilename exch store % grab passed pix file /photoscale exch store /vpixels exch store /hpixels exch store % (\nvpixels = )print vpixels == % (\nhpixels = )print hpixels == % (\photoscale = ) print photoscale == % (\ninurllink = ) print inurllink == % (\ninfilemane = ) print infilename == translate % adjust position for final figure ??? inurllink setareaurl % autolink sizing /DeviceRGB setcolorspace % pick color model 0 0 translate % set page position hpixels vpixels scale % magnify unit square photoscale dup scale /infile infilename (r) file def % establish input read file /Data {infile /DCTDecode filter} def % define a data source << % start image dicationary /ImageType 1 % always one /Width hpixels % JPEG width in pixels /Height vpixels % JPEG height in pixels /ImageMatrix [hpixels 0 0 vpixels neg 0 vpixels ] /DataSource Data % proc to get filtered JPEG /BitsPerComponent 8 % color resolution /Decode [0 1 0 1 0 1] % per red book 4.10 >> image % call the image operator ypos snap2 restore /ypos exch def } def /setareaurl { % for auto include routine /cururlname exch store mark % start pdfmark /Rect [ 0 0 hpixels photoscale mul vpixels photoscale mul ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def % uncomment alternate setareaurl when no link? % /setareaurl { pop } def /medblue {0.65 0.75 1 setrgbcolor } store /darkblue {0.30 0.40 1 setrgbcolor } store /darkgreen {0.2 0.5 0.8 setrgbcolor } store /black {0 0 1 setrgbcolor } store %%%%%%%%%%%%%%%%%%%% Project Starts Here %%%%%%%%%%%%%%%%%%% % Uncomment and modify to use disk based Gonzo. ( or other disk access ) (C:/Users/Don/Desktop/Ghost/gonzo.psl) run /guru { gonzo begin ps.util.1 begin printerror nuisance begin} def guru % activate gonzo utilities 50 50 10 setgrid % draw a 20x20 green box example % 53 71 showgrid % uncomment for layout grid /cstretch 0.01 store /sstretch 0.01 store /yinc 1.1 store /txtwide 24 store /font1 /StoneSans 0.95 gonzofont /font3 /StoneSans-Bold 0.95 gonzofont /font2 /StoneSans [0.45 0 0 0.45 0 0.4 ] gonzofont /font4 /StoneSans [0.85 0 .2 0.95 0 0 ] gonzofont /font5 /StoneSans-Bold [0.75 0 .2 0.95 0 0 ] gonzofont /font6 /StoneSans [1.3 0 .3 1.3 0 0 ] gonzofont /font7 /StoneSans-Bold [1.3 0 .3 1.3 0 0 ] gonzofont /font8 /StoneSans-Bold [0.6 0 .23 0.6 0 0.6 ] gonzofont /pm 2 store /tinaja1 {(https://www.tinaja.com) eurl} store /ps1 {(https://www.tinaja.com/pssamp1.shtml) eurl} store /kern 0.02 store 1 setlinejoin 1 setlinecap darkgreen 0 -0.5 mt 71.5 pu 53 pr 71.5 pd closepath 0.3 setlinewidth stroke 25 -1.5 mt 2 pu 2 pr 2 pd closepath gsave white fill grestore darkgreen 0.3 setlinewidth stroke font3 25.9 -0.8 (1|k6) cc % this image requires a local copy of http://www.tinaja.com/images/forthprin1.jpg % othwerwise comment it out... /localfile (C:/Users/don/Desktop/BusLet/sigforth/forthprin1.jpg) store /imagelocaldirectory (C:/Users/don/Desktop/BusLet/sigforth/) store % fwd slashes for win /imageremotedirectory (http://www.tinaja.com/) store % fwd slashes for chrome /imagelocalsource imagelocaldirectory (forthprin1.jpg) mergestr store % comes from local file gsave 0.8 59 % page translate ( data for jpegimageprocwithlink ) 824 634 % hpixels and vpixels 0.1 0.15 mul % photoscale imagelocalsource % local jpg source imageremotedirectory % image url on clickthru jpegimageprocwithlink grestore font7 darkgreen 19.0 67.7 (|6Don |j|jLancaster)cc font6 /adj {/ypos ypos 0.22 add store} store 19.0 65.7 (|7What |kis |kPostScript? |h|/adj A Tutorial) cc 7 57.3 (|7The |jPostScript|8 TM|7 |h|/adj Guest |jColumn) cc font1 black /txtwide 12 store 13.5 61.7 (|4|y|z [Editor's Note: this article is an introduction to the |/surl |/darkgreen |5PostScript|/ps1 |4|/black |klanguage. In it, Don discusses PostScript features and advantages, fonts, speed and your costs, how to get started and how to buy a new )cf black /txtwide 24 store 1.5 54 (|z|y|4 PostScript printer. Copyright (C) 1990 by Don Lancaster and Synergetics, 3860 West First Street, Thatcher, AZ. 85552. All commercial rights reserved. Personal use permitted so long as this header remains present and intact. Write or call for free PostScript "insider secrets" brochure and product list. Free PostScript helpline 8-5 weekdays, mountain standard time: (928) 428-4073. Or visit |/surl |5https://www.tinaja.com|/tinaja1 |4.] ) cf black 1.5 45.7 (|1|p|y What makes Adobe System's PostScript|2TM|1 language so great? Why has it become the page description language for almost all serious desktop publishing? Maybe we should start off with a simpler question "Just what is the PostScript language?" |h Well, PostScript is a new computer language that is normally provided as firmware already built into a PostScript-speaking laser printer or phototypesetter. You most often will not go out and buy a copy of PostScript. Instead, you purchase or lease a ready-to-go PostScript speaking laser printer or phototypesetter. Or else you bolt a new PostScript-speaking lid onto an older and more primitive printer or phototypesetter to upgrade it. Or you can buy PostScript emulators for use on non-PostScript printers. |h To use PostScript, all you need is some way of sending ordinary ASCII textfiles to it. These textfiles hold the words and numbers which make up your program. This can be done with any word processor, editor, or comm program on any computer. There are also higher level "power" programs that will auto generate PostScript code for you, plus emulation software that lets PostScript imitate most any older and poorer graphics language. |h One key point that most beginners miss is that PostScript is a general purpose computer language. So, most anything you can do in "C", or in BASIC, COBOL, Fortran or Pascal, could also be done with PostScript. Along with any other general purpose computer language, there are some things that do get done quite well and some not so well. PostScript happens to excel at putting nice looking marks onto a printed page. |h Thus, besides its being a totally general purpose computer language, PostScript also turns out to be an absolutely outstanding page description language, or PDL, for desktop on up through high-end publishing. PostScript will usually have three different ways of outputting its answer. One is to make marks on a page |h) cf 27 68.8 (|1and then print that page. The second is to send results back to your host computer via your serial, AppleTalk or SCSI comm channel. And the third is to write files to and from a SCSI hard drive or CD ROM compact disk. |h|p Many beginners often presume that PostScript can only output printed hard copy. And thus they miss two thirds of PostScript's richness. |h For instance, I routinely use the PostScript in my LaserWriter NTX with its 12 megabytes of RAM and its 68020 as the "mother's little helper" coprocessor for the 65C02 in my Apple lie. Which really does snap things up a tad At one time, the controller card in the original LaserWriter was far and away the most powerful computer that Apple built. |h|z|/darkgreen |3What Are The Main Features Of PostScript? |h|p|/black |1PostScript is related to the Forth language as a third cousin twice removed and seven times disowned. It is an exceptionally easy language to learn, and then quickly becomes totally and permanently addictive. As with Forth, PostScript does use a reverse polish or postfix notation. While weird to look at the first time you see it, thjs arrangement turns out to let you write exceptionally fast and quite clean high level code. |h PostScript is normally interpreted But it is quite easy to compile or even pseudo compile PostScript sequences for much faster operation. |h Two important features of PostScript as a general purpose language is that it is threaded and reentrant. This means that any PostScript command can call any other command, nestled to virtually any depth. Thus any command or command sequence in the language can serve as a subroutine to any other command or any command seouence. |h A second major feature of PostScript as a general purpose language is that it is extensible. This means you can add as many new commands to the language as you like any way you want at any time. The only catch is that anything new has to get defined through new combinations of already existing commands. |h You can also change the name or the meaning of any existing command. For instance, your single new command ''book" could automatically print up to 25 copies of your 50 chapter book-on-demand printed math text routed to your customized mailing list, including all equations and all figures and all art, even color photographs if you want to. And do all the invoicing and paper ordering in its spare time. |h While there are some 600 commands presently in the PostScript language, you could start doing interesting work by using only a dozen of these. On the other hand, you could easily add thousands of commands of your own, so that the language will become uniquely yours to do with as you please. |h A third major feature of PostScript as a general purpose language is that it is stack oriented. A stack is similar to the pile of trays at the start of the cafeteria line. The stack manipulations can be very fast, because |k ) cf showpage % EOF (woof AZ. 85552. All commercial rights reserved. Personal use permitted so long as this header remains present and intact. Write or call for free PostScript "insider secrets" brochure and product list. Free PostScript helpline 8-5 weekdays, mountain standard time: call (928)428-4073.)pop