%!PS % Gonzo PS Powerpoint emulation example: Revised Gila Tech paper % ========================================== % by Don Lancaster % Copyright c 2002, 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 % Shows how most PowerPoint functions can be created from raw PostScript % with significant speed, size, appearance, and web distribution advantages. % To use, modify features and content as desired, resave as a standard ASCII % textfile to a new name and send to Acrobat Distiller to generate a PDF file. % IMPORTANT NOTE: Don Lancaster's file gonzo.ps is required for this program. % After obvious location mods, uncomment ONE of the following two lines: % (C:\\Documents and Settings\\don\\Desktop\\gonzo\\gonzo.ps) run % use internal gonzo (C:/Users/Don/Desktop/Ghost/gonzo.psl) run % (A:\\gonzo.ps) run % use external gonzo % GONZO20A Guru Gonzo PostScript power tools (Interim release) % Includes gonzo justification and layout utilities. % Copyright c 1990, 1996, 2001 by Don Lancaster and Synergetics, Box 809, % Thatcher Arizona, 5552 (928) 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. /guru { gonzo begin ps.util.1 begin printerror nuisance begin} def % guru % activate gonzo utilities %%%%%%%%%%% 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 /su {font3 surl} def % shorthand % /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 % dictionary method << %zzzzz /gramtram (https://www.tinaja.com/glib/tramshow.pdf) /unusualh (https://www.tinaja.com/glib/unusualh.pdf) /safgbook (http://www.tinaja.com/images/safgbook.jpg) /gilahike (https://www.tinaja.com/gilahike.shtml) /wifi (https://en.wikipedia.org/wiki/Wi-Fi) /gps (https://en.wikipedia.org/wiki/Global_Positioning_System) /fablab (https://www.eac.edu/Academics/Programs_of_Study/AdvancedManufacturing/) /freeport (https://fcx.com/operations/north-america) /mgio (http://mgio.arizona.edu/) /tomato (https://naturesweet.com/) /tinsamp1 (https://www.tinaja.com/tinsamp1.shtml) /maildon (mailto:don@tinaja.com) >> {mark exch /eurl cvx ] cvx def} forall % color emphasis /tinton1 {mark 0.25 0.25 0.25 /setrgbcolor cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1a {mark 0.5 /settint cvx 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1r {mark 0 /settint cvx 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 font3} store % tinton emphasis /tx {tintoff font1} store % tintoff /staytint {0.25 0.25 0.25 setrgbcolor} store % grayout /staytint1r {0 settint 0.25 setgray} store % red /staytint1a {0.5 settint 0.33 setgray} store % aqua %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% parameter dictionary %%%%%% /slideshowdict << % this dictionary determines the slide sequence /sequence [ /Gila_Tech ] store % only one page today /gridsize 10 store % default layout grid size = 10 /slidewide 44 pop 50 % total display width in grid units /slidehigh 33 pop 40 % total display height /borderwide 2.5 % width of white vertical edges /borderhigh 2.5 % width of white horizontal edges /includeborder false % provide white border? /normalbackground /burpbackmain % name of main background proc /introbackground /burpbackintro % name of intro background proc /fontsused /burpfonts % name of font set used /patstrings /burppatstrings % name of patterns used /titx 6 % x grid position of title /tity 28.75 9 add % y grid position of title /bodx 6 pop 8 % x grid position of body /body 28 % y grid position of body /ivoryrndcolor [230 230 205 40] % random pattern colors [red blue green variance ] /magentarndcolor [230 100 230 120] /magentaaccent [0.65 0.05 0.65 ] % title accent slash color [red blue green] >> def slideshowdict begin % open slide show dictionary %%%%%%%%%%%%%%%%% style catalogs %%%%%%%%%%%%%%%%%% % burp is a mottled gray body with random magenta splotch and stripe /burpfonts { /cstretch 0.010 store /sstretch 0.010 store /kern 0.1 store /font0 /StoneSans-Bold 1.8 gonzofont % body titles /font1 /StoneSerif 1.35 gonzofont % normal body /font2 /StoneSerif-Bold 1.20 gonzofont % boxed subseries /font3 /StoneSerif-Bold 1.35 gonzofont % bold body /font4 /StoneSerif-Bold 1.25 gonzofont % smaller font3 for numerals /font5 /StoneSerif-Bold 1.85 gonzofont % oversize for math /font6 /StoneSans-Bold 2.8 gonzofont % titleslide oversize /font8 /StoneSerif-Bold 1 gonzofont % fine print copyright /font9 /ZapfDingbats 1.05 gonzofont % black boxes /font: /StoneSerif-Bold [2 0 0 2 0 -.5] gonzofont % special math * /font; /StoneSerif-Bold [1.4 0 0 1.4 0 .9] gonzofont % fake degrees * /titlefont {font0 }store % define title font /bodyfont {font1} store % defint body font /bodysubfont {font2}store % define bodysubfont /bodytxwide {/txtwide 35.5 store}store /bodyyinc {/yinc 2 store} store } store /burpbackmain { includeborder {borderwide 10 mul borderhigh 10 mul}{0 0} ifelse gridsize setgrid % set grid scale save /snap1 exch store % show the body background bodypatdict matrix % Identity matrix makepattern % Instantiate the pattern /bodypat exch def 0 0 % for the actual slide size slidewide slidehigh /Pattern setcolorspace bodypat setcolor rectfill % Fill rectangle with pattern snap1 restore save /snap1 exch store % show the accent accentpatdict matrix % Identity matrix makepattern % Instantiate the pattern /accentpat exch def 0 slidehigh 13.5 sub 5.5 add % splotch size 4.5 13.5 /Pattern setcolorspace accentpat setcolor rectfill % Fill rectangle with pattern snap1 restore % black outline black line1 0 0 slidewide slidehigh 0.0 setgray rectstroke % Stroke original black outline % accent lines gsave magentaaccent aload pop setrgbcolor 0.7 setlinewidth 1 setlinecap 2 27.5 8.5 add mt slidewide 4.5 sub r % 0 setlinecap 0 27.5 mt 3 r 0.45 setlinewidth 1 setlinecap % slidewide 13 sub 2.5 mt 12 r 2 2.5 mt 45.7 r % temp fix %zzz % slidewide 2.5 mt 0 setlinecap 2 l grestore fontsused cvx exec % set fonts for normal slide by name } store /burpbackintro { includeborder {borderwide 10 mul borderhigh 10 mul}{0 0} ifelse gridsize setgrid % set grid scale save /snap1 exch store % show the body background bodypatdict matrix % Identity matrix makepattern % Instantiate the pattern /bodypat exch def 0 0 % for the actual slide size slidewide slidehigh /Pattern setcolorspace bodypat setcolor rectfill % Fill rectangle with pattern snap1 restore save /snap1 exch store % show the accent accentpatdict matrix % Identity matrix makepattern % Instantiate the pattern /accentpat exch def 5.5 16.5 33 6 add 12 /Pattern setcolorspace accentpat setcolor rectfill % Fill rectangle with pattern snap1 restore % black outline black line1 0 0 slidewide slidehigh 0.0 setgray rectstroke % Stroke original black outline % accent lines gsave magentaaccent aload pop setrgbcolor 0.35 setlinewidth 1 setlinecap 1 setlinejoin 5.5 16.5 0.8 sub mt 13.6 pu -.8 -.8 rlineto 34.6 6 add pr -.8 .8 rlineto 13.6 pd .8 .8 rlineto 34.6 6 add pl closepath stroke 0.35 setlinewidth 1 setlinecap 1 setlinejoin 0 3 mt 12 pr 3 pr 1.4 pu 20 pr 2.8 pd 20 pl 1.4 pu 1.4 pd 20 pr 1.4 pu 12 pr 3 pr stroke grestore fontsused cvx exec % set fonts for normal slide by name } store /burppatstrings { ivoryrndcolor buildpixels makeimagestring /bodypatstring exch store magentarndcolor buildpixels makeimagestring /accentpatstring exch store } store %%%%%%%%%%%%%%% pattern utilities %%%%%%%%%%%%%%%%%% /DeviceRGB setcolorspace % pick color model /hpixels 50 store % size of pattern image /vpixels 50 store /issize hpixels vpixels mul store % makestring converts a stack top array into a string... /makestring {dup length string dup /NullEncode filter 3 -1 roll {1 index exch write} forall pop} def % /buildpixels makes three nearby colors given [r b g texture] all 0-255 integers /buildpixels {aload pop /texture exch store /b0 exch store /g0 exch store /r0 exch store 123 srand /r1 r0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /g1 g0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /b1 b0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /r2 r0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /g2 g0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /b2 b0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /r3 r0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /g3 g0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /b3 b0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store } store % /makeimagestring creates a sting usable for a pattern image /makeimagestring { 12345 srand % make repeatable /iarray mark issize { r1 g1 b1} repeat ] store % fill all with color 1 issize 2 div cvi { iarray issize % fill half with color 2 random 3 mul cvi [ r2 g2 b2 ] putinterval} repeat issize 2 div cvi { iarray issize % fill third with color 3 random 3 mul cvi [ r3 g3 b3 ] putinterval} repeat iarray makestring } store % /rndimage shows the random string as a patternable image /bodyrandimage { gsave 5 dup scale << % start image dicationary /ImageType 1 % always one /Width hpixels % width in pixels /Height vpixels % height in pixels /ImageMatrix [hpixels 0 0 vpixels neg 0 vpixels ] /DataSource bodypatstring % proc to get string data /BitsPerComponent 8 % color resolution /Decode [0 1 0 1 0 1] % per red book 4.10 >> image % call the image grestore } def /accentrandimage { gsave 5 dup scale << % start image dicationary /ImageType 1 % always one /Width hpixels % width in pixels /Height vpixels % height in pixels /ImageMatrix [hpixels 0 0 vpixels neg 0 vpixels ] /DataSource accentpatstring % proc to get string data /BitsPerComponent 8 % color resolution /Decode [0 1 0 1 0 1] % per red book 4.10 >> image % call the image grestore } def % using a separate pattern dictionary for each pattern... /bodypatdict << /PatternType 1 % Tiling pattern /PaintType 1 % Colored /TilingType 1 /BBox [0 0 50 50] /XStep 5 /YStep 5 /PaintProc { begin bodyrandimage end} >> store /accentpatdict << /PatternType 1 % Tiling pattern /PaintType 1 % Colored /TilingType 1 /BBox [0 0 50 50] /XStep 5 /YStep 5 /PaintProc { begin accentrandimage end} >> store % /makepatternstrings generates the needed patterns /makepatternstrings { [230 210 190 80] buildpixels makeimagestring /accentpatstring exch store [230 100 230 120] buildpixels makeimagestring /bodypatstring exch store } store %%%%%%%% end pattern utils %%%%%%%% %%%%%%% service utilities %%%%% /makeslideshow {setupshow sequence { save /snapxx exch store cvx exec showpage snapxx restore} forall } store /settitle { titlefont gsave 0.25 0.25 0.25 setrgbcolor titx exch tity exch cl grestore} store /setbody { bodyfont bodytxwide bodyyinc bodx exch body exch cl} store % /setupshow first locks out pdfmark from a printer, then sets % the page mode. /setupshow { /pdfmark where {pop}{userdict /pdfmark /cleartomark load put} ifelse [/CropBox [0 0 slidewide includeborder {borderwide 2 mul add} if gridsize mul slidehigh includeborder {borderhigh 2 mul add} if gridsize mul ] % set the wierd size /PAGES pdfmark [ {Catalog} << /ViewerPreferences << /FitWindow true /CenterWindow true >> /PageLayout /SinglePage % no rolling /Pagemode /FullScreen % fullscreen if not on web /View [/XYZ null null 1 ] % force 100% >> /PUT pdfmark % then makes background pattern strings ONCE for later access patstrings cvx exec % get patterns from style area } def %%%%%% background generators %%%%%%%% /setbackground { normalbackground cvx exec } store % link selected background /settitlebackground { introbackground cvx exec } store %%%%%%% individual slide data %%%%%%%% /Gila_Tech { setbackground /font7 /Helvetica 0.1 gonzofont (High Tech Features of the Gila Valley\274) settitle /tabs [0 0 0 ]store % 4 is normal /txtwide 49 store /resettxtwide {/txtwide 500 store} store /bodyyinc {/yinc 1.55 store} store (|h|y|h|3|t|9n|4 0. The prehistoric |/surl Bajada Hanging Canals|/tinsamp1 . |h |t|9n|4 1. The |/surl Safford Grids|/safgbook . |h |t|9n|4 2. The |/surl Mount Graham Telescopes|/mgio |h |t|9n|4 3. The |/surl Copper Mines|/freeport + solvent + electrowinning |h |t|9n|4 4. The Mount Graham |/surl Aerial Lumber Tramway|/gramtram . |h |t|9n|4 5. The five |/surl Morenci Southern Railway Loops|/unusualh . |h |t|9n|4 6. The |/surl Ash Creek Flumes|/gilahike . |h |t|9n|4 7. |/surl Emigrant Marble Quarry|/unusualh . |h |t|9n|4 8. Ubiquous |/surl WiFi|/wifi Web Comm. |h |t|9n|4 9. The |/surl Tomato Factory|/tomato . |h |t|9n|4 10. Cotton Drip Irrigation + |/surl GPS|/gps . |h |t|9n|4 11. The |/surl EAC Fab Lab|/fablab . ) setbody } store %%%%%%%%% main loop %%%%%%% makeslideshow % this does it all % EOF