%!PS % "Level II" automatic book layout for Vee project EW format thermoluminescence study % ==================================================== % by Don Lancaster THML45.PSL page 45 % Copyright c 2011 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 % 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 off Don % Program to change Illustrator coordinates to Gonzo coordinates. % Usuall involves 10:1 scaling, vertical inversion, and reduction to 4 dp from 6. /procarray { /curarray exch store curarray dup length 1 sub get (cv) eq {cvadjust} if curarray dup length 1 sub get (mo) eq {moadjust} if curarray dup length 1 sub get (li) eq {liadjust} if curarray dup length 1 sub get (]msf) eq {msfadjust} if } store /msfadjust {/modified true store % only unrotated fonts shifted! % curarray 0 get ( ) mergestr curarray 1 get dup length 2 sub 1 exch getinterval % bizarre [repair curarray exch 1 exch put curarray 2 get (0) eq {fixregfontmat} if (/font1 ) curarray 0 get mergestr ( rf[ ) mergestr curarray 1 get mergestr ( ) mergestr curarray 2 get mergestr ( ) mergestr curarray 3 get mergestr ( ) mergestr curarray 4 get mergestr ( ) mergestr curarray 5 get mergestr ( ) mergestr curarray 6 get mergestr ( ) mergestr ( ] gonzofont /font1) mergestr /curlinex exch store } store /fixregfontmat { % repair only if not rotated curarray 1 get cvr xgain div 100 mul round cvi 100 div 20 string cvs curarray exch 1 exch put curarray 2 get cvr xgain div 100 mul round cvi 100 div 20 string cvs curarray exch 2 exch put curarray 3 get cvr xgain div 100 mul round cvi 100 div 20 string cvs curarray exch 3 exch put curarray 4 get cvr xgain div -100 mul round cvi 100 div % INVERT! 20 string cvs curarray exch 4 exch put curarray 5 get cvr xgain div 100 mul round cvi 100 div 20 string cvs curarray exch 5 exch put curarray 6 get cvr xgain div 100 mul round cvi 100 div 20 string cvs curarray exch 6 exch put } store /moadjust {/modified true store % moveto adjust curarray 0 get cvr xoffset sub xgain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr curarray 1 get cvr yinversion exch sub ygain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr mergestr (mo) mergestr /curlinex exch store } store /liadjust {/modified true store % moveto adjust curarray 0 get cvr xoffset sub xgain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr curarray 1 get cvr yinversion exch sub ygain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr mergestr (li) mergestr /curlinex exch store } store /cvadjust {/modified true store % curveto adjust curarray 0 get cvr xoffset sub xgain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr curarray 1 get cvr yinversion exch sub ygain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr mergestr curarray 2 get cvr xoffset sub xgain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr mergestr curarray 3 get cvr yinversion exch sub ygain div 10 mul cvi 10 div 20 string cvs ( ) mergestr mergestr curarray 4 get cvr xoffset sub xgain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr mergestr curarray 5 get cvr yinversion exch sub ygain div 10 mul round cvi 10 div 20 string cvs ( ) mergestr mergestr (cv) mergestr /curlinex exch store } store /linetoarray { /remline curline store mark remline 25 { ( ) search not { ] exit} if exch pop exch } repeat % have array at this point procarray } store /processline {/curline exch store /modified false store linetoarray linetoarray modified not {curline print (\n) print flush } {curlinex print (\n) print flush} ifelse } store % temp line process /dothetransform { /fullname tobetransferredpath tobetransferredfilename mergestr store fullname (r) file /workfile exch store /linestr 1000 string store 1000 { workfile linestr readline not {exit} if processline } repeat } store %%%%%%%%%%% demo - remove or alter before reuse %%%%%%%%%%%%%% % input data /tobetransferredfilename (ref422b.txt) store /tobetransferredpath (C:\\Documents and Settings\\don 2\\Desktop\\EW reprints\\new gonzo\\) store % xillus of 226 to be grid 2 xillus of 350 to be grid 20 xgain is 6.888 % want 226 to be 2 13.777 ---> 212.2 % on y want 177 to also be 13.777 --> 190.7 yinversion /xoffset 212.2 store /yinversion 190.7 store /xgain 6.888 store /ygain xgain store % symmetric (\n\n\n) print flush (%%%%%%%%%%%% illustrator to gonzo translation %%%%%%%%%%%%%%\n\n) print flush (% Original filename: ) tobetransferredfilename mergestr (\n) mergestr print flush (% Original path: ) tobetransferredpath mergestr (\n\n) mergestr print flush (% xoffset: ) xoffset 20 string cvs mergestr (\n) mergestr print flush (% yinversion: ) yinversion 20 string cvs mergestr (\n\n) mergestr print flush (% xgain: ) xgain 20 string cvs mergestr (\n) mergestr print flush (% ygain: ) yinversion 20 string cvs mergestr (\n\n) mergestr print flush dothetransform % this does it all (%%%%%%%%%%% end translation %%%%%%%%%%\n\n\n) print flush % EOF