PRO OPEN_PS ;+ ; NAME: ; OPEN_PS ; PURPOSE: ; Opens a file for POstScript graphics output ; CATEGORY: ; Utility ; CALLING SEQUENCE: ; OPEN_PS ; INPUTS: ; User is prompted for ; Change of font (default=no change ==> Helvetica 12-pt) ; Orienatation (default=Portrait) ; Output filename (default=PS.PLOT) ; OPTIONAL INPUT PARAMETERS: ; None ; KEYWORD PARAMETERS: ; ; OUTPUTS: ; None ; OPTIONAL OUTPUT PARAMETERS: ; None ; COMMON BLOCKS: ; PS_STUFF,Pfont,Dname,Ps_filename ; used by CLOSE_PS to reset font, graphics device type, and to enable ; it to print a ^D to the file for comptability with QMS printer ; SIDE EFFECTS: ; Opens a file for plotting; sets plot type to PostScript; ; sets !P.FONT to 0 (if a font change requested) ; RESTRICTIONS: ; None known. ; PROCEDURE: ; ; MODIFICATION HISTORY: ; T.J.Hughes, HIA/NRCC , November 30, 1990 ;- common ps_stuff,pfont,dname,ps_filename cfont='' read,'Change font? (y/[n]) ',cfont cfont=strupcase(cfont) nfont='' if cfont eq 'Y' then begin PROMPT_AGAIN: print,' ' read,'Enter font name (e.g. /times,/bold) (? for help) ',nfont if nfont eq '?' then begin openr,inunit,'dan$:[hughes.idl]ps.fonts',/get_lun line='' & readf,inunit,line count=0 while not eof(inunit) do begin print,line count=count+1 if count gt 20 then begin print,' ' junk='' read,' Hit to continue ...',junk count=0 erase endif readf,inunit,line endwhile free_lun,inunit goto, prompt_again endif nfont=','+nfont endif orient='' read,'Landscape or Portrait? (L/[P]) ',orient orient=strupcase(orient) if orient eq 'L' then orient=',/landscape' else orient=',/portrait' pfile='' read,'Plot file name ([PS.PLOT) ',pfile if pfile eq '' then begin ps_filename='PS.PLOT' pfile="'PS.PLOT'" endif else begin ps_filename=pfile pfile="'"+pfile+"'" endelse dname=!d.name pfont=!p.font set_plot,'ps' if cfont eq 'Y' then !p.font=0 dev_string='device,file='+pfile+orient+nfont istat=execute(dev_string) return end