;+
;NAME:
pro psshut,quiet=quiet
;KEYWORD:	Tool
;PURPOSE:
;	Close Post Script Device
;		(See also 'pssetup.pro')
;CALLING SEQUENCE:
;	psshut
;OPTIONAL KEYWORDS:
;	quiet	: quiet mode
;COMMON
	common psutil,fname,eps,epsfname
;HISTORY
;	95-09-20 ver 2.0	T.Yoshida
;-
	if keyword_set(quiet) then nq=0 else nq=1
	pname='%%% psshut: '
;Close
	device,/close
	if nq then print,pname+'Close Output file : '+fname
;EPSI
	if eps eq 1 then begin
		if nq then print,pname+'Convert temporary file to eps file'
		cmd=['ps2epsi',fname,epsfname]
		if nq then print,string(cmd+' ',format='(3A)')
		spawn,/noshell,cmd
		cmd=['rm',fname]
		spawn,/noshell,cmd
		if nq then print,pname+'Remove temporary file : '+fname
	endif
;Clean Font
	!p.font=-1
	if nq then print,pname+'Use IDL fonts.'
;Open X Device
	set_plot,'x'
	if nq then print,pname+'Change output device to X.'
end
