%! % Fake PostScript Log generator % Any unmodified Google Drive appears to generate an error on % any PostScript program whose primary output is a log file. Such programs % are enormously useful when using PostScript to generate % code in most any other language. % Log files can be faked by diverting their new intended code % generation to the main .PDF program. In this example, there % is no other .pdf intended output. % This simple example only accepts single text lines. % ///////// (A) WEB FRIENDLY COLOR UTILITIES ///////////// % tintmat is a self-generating list of 216 triple color values /webtintmat [ 0 1 5 { /a exch store 0 1 5 { /b exch store 0 1 5 { 5 div b 5 div a 5 div }for } for } for ] def % setwebtint accepts a color number 0 to 215 and then % sets the PostScript color generator for later use... /setwebtint { abs cvi 216 cvi mod % restrict range webtintmat exch 3 mul 3 getinterval % get values from table aload pop setrgbcolor} def % and set them % The blocks are arranged as red to the right, green % up in order of increasing blue. % Some "pure color" sequences are % red: 0 1 2 3 4 5 % orange: 0 7 8 15 16 23 (sort of) % yellow: 0 7 14 21 28 35 % green: 0 6 12 18 24 30 % aqua: 0 42 84 126 168 210 % blue: 0 36 72 108 144 180 % magenta: 0 37 74 111 148 185 % purple 0 73 73 110 147 183 (sort of) % gray 0 43 86 129 172 215 % ////////////// GONZO EXCERPTS ////////////////// /setgrid { /blocksize exch def translate % simplified blocksize dup scale} def % 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 % 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 /showgrid {gsave /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 /fatterborder {true } store /fat5 {false} store /fatter10 { false} store /thingridlines {0} def % /////// LOGFILE EMULATOR ////////////// /showthegrid true store /gridwide 53 store /gridhigh 68 store /xpos 3 store /ypos gridhigh 1 sub store /yinc 1 store /ybottrip 6 store /endofblock false store /StoneSans findfont 1 scalefont setfont % for google drive /startagrid { 50 50 10 setgrid % prefer to work 10x + Gonzo showthegrid {32 setwebtint gridwide gridhigh showgrid 0 setwebtint } if % optionally show grid /StoneSans findfont 1 scalefont setfont } store /showaline {xpos ypos moveto show /ypos ypos 1 sub store endofblock ypos 6 pop 12 lt and % for new extension {showpage 30 ypos moveto 100 100 rlineto stroke % 0 0 moveto 1000 1000 lineto stroke % gsave 30 30 translate 0 0 moveto % 100 0 lineto 100 100 lineto fill grestore 50 50 10 setgrid % prefer to work 10x + Gonzo showthegrid {32 setwebtint gridwide gridhigh showgrid} if /ypos gridhigh 1 sub store 0 setwebtint } if } store % /////////// CODE TO BE LOG FILE FAKED GOES BELOW HERE //////////// % This is a .SHTML revision example /yrfull (2015) store /yr2 (15)store /mofull [(January)(February)(March)(April)(May)(June)(July)(August)(September)(October)(November)(December)] store /mo2 [(31)(28)(31)(30)(31)(30)(31)(31)(30)(31)(30)(31)] store /buildhead {11 -1 0 { /curmo exch store mofull curmo get /curmofull exch store % get current month mo2 curmo get cvi -1 1 {3 string cvs /curday exch store % get current day buildheadx } for (\n) print % month break } for } store /buildheadx { xpos ypos moveto show /xpos 3 store /ypos ypos 1 sub store endofpatch ypos 6 lt and % dup == { showpage /ypos gridhigh 1 sub store 50 50 10 setgrid % prefer to work 10x + Gonzo showthegrid {32 setwebtint gridwide gridhigh showgrid} if /ypos gridhigh 1 sub store 0 setwebtint /StoneSans findfont 1 scalefont setfont } if } store %%%%%%%%%%%%%%%% January next year patch %%%%%%%%%%%%%%%% /janpatch { /endofpatch false store 15 -1 1 {3 string cvs /day exch store % for each january day /endofpatch false store % no break at beginning day length 2 lt {(0) day mergestr } {day}ifelse /dayx exch store % line #1 ( ) mergestr buildheadx % line#2 (
January ) dayx mergestr
(, ) mergestr
yrfull cvr 1 add cvi 4 string cvs mergestr
(
) mergestr buildheadx
% line#3
( deeplink • ) mergestr buildheadx
% line#4
( top • ) buildheadx
% line#5
( bot • ) buildheadx
% line #6
( respond
) buildheadx (
) buildheadx () buildheadx ( ) buildheadx ( ) buildheadx % line #7 /endofpatch true store % attempt a full block (\n) buildheadx } for /endofpatch true store (\n \n) buildheadx } store %%%%%%%%%%%%%%%%%% main %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /yearpatch { /endofpatch false store 11 -1 0 {/month exch store % for each month mo2 month get cvi -1 1 {/day exch store % for each day /endofpatch false store month 1 add 3 string cvs dup length 2 lt { (0) exch mergestr } if /monthx exch store day 3 string cvs dup length 2 lt { (0) exch mergestr } if /dayx exch store % line #1 ( ) mergestr buildheadx % line#2 (
January ) dayx mergestr
(, ) mergestr
yrfull mergestr
(
) mergestr buildheadx
% line #3
( top • ) buildheadx
% line#5
( bot • ) buildheadx
% line #6
( respond
) buildheadx (
) buildheadx () buildheadx ( ) buildheadx ( ) buildheadx /endofpatch true store (\n \n) buildheadx } for } for /endofpatch true store (\n \n) buildheadx } store %%%%%%%%%%%%%%%%%%%%%%%%% previous december patch %%%%%%%%%%%%%%%% /decpatch { /endofpatch false store 31 -1 15 {3 string cvs /day exch store % for each january day /endofpatch false store % no break at beginning day length 2 lt {(0) day mergestr } {day}ifelse /dayx exch store % line #1 gottodec ( ) mergestr buildheadx % line#2 (
January ) dayx mergestr
(, ) mergestr
yrfull cvr 1 sub cvi 4 string cvs mergestr
(
) mergestr buildheadx
% line#3
( deeplink • ) mergestr buildheadx
% line#4
( top • ) buildheadx
% line#5
( bot • ) buildheadx
% line #6
( respond
) buildheadx (
) buildheadx () buildheadx ( ) buildheadx ( ) buildheadx (\n) buildheadx } for /endofpatch true store (\n \n) buildheadx } store 50 50 10 setgrid % prefer to work 10x + Gonzo showthegrid {32 setwebtint gridwide gridhigh showgrid 0 setwebtint } if % optionally show grid janpatch /endofpatch true store (\n \n) buildheadx yearpatch % main year /endofpatch true store (\n \n) buildheadx decpatch showpage % EOF