[comp.lang.postscript] Why does this program fail?

crocker@ihlpf.ATT.COM (Crocker) (04/11/89)

This program fails when I print it on our LaserWriter using the
Sun print spooler.  It works fine under NeWS.  Any ideas?

Thanks in advance...

Ron Crocker
AT&T Bell Laboratories
(312) 416-5262

<><><><><><><><><><><><><><><><> cut here <><><><><><><><><><><><><><><><>
%!
8.5 72 mul 0 moveto (hi) show
showpage
0 0 moveto
.75 .75 scale
/plotCity {
	900 exch sub exch
	922 exch sub
	moveto
	(\267) show show
} def
(Sioux City  IA) 646.8 476.8   plotCity
(Tallahassee  FL) 787.7  171.6   plotCity
(Eau Claire  WI) 569.8  426.1   plotCity
(Las Vegas  NV) 866.5  741.1   plotCity
(Dallas  TX) 843.8  403.0   plotCity
(Albuquerque  NM) 854.9  588.7   plotCity
(Richmond  VA) 590.6  147.2   plotCity
(Louisville  KY) 652.9  277.2   plotCity
(Sioux Falls  SD) 627.9  490.0   plotCity
(Spokane  WA) 624.7  818.0   plotCity
(Birmingham  AL) 751.8  244.6   plotCity
(Helena  MT) 633.6  734.8   plotCity
(Seattle  WA) 632.1  889.4   plotCity
(Cleveland  OH) 558.6  255.7   plotCity
(Memphis  TN) 747.1  312.5   plotCity

showpage

orkb@stl.stc.co.uk (Owen Benson) (04/12/89)

Before `show'ing a string in PostScript you must have a font set. Your
program worked in NeWS because NeWS does a `setfont' when it starts up
(so it can print the opening banner).
So, just add, say :
	/Times-Roman findfont 10 scalefont setfont
at the begining of your program (anywhere before the first `show') and
it should print out.

P.S. It will fit on the paper better if you do :
	90 rotate
	0 -500 translate
before /plotcity ... def.
:-----:-----:-----:-----:-----:-----:-----:-----:-----:-----:-----:-----:
Owen R K Benson
STC Technology Ltd			       JANET: orkb@stl.stc.co.uk
London Road, Harlow, Essex, England            Tel:   (0279) 29531 x2363

curtj@pogo.WV.TEK.COM (Curt Jutzi) (04/13/89)

In article <8199@ihlpf.ATT.COM> crocker@ihlpf.UUCP (Crocker,R.T.) writes:
>This program fails when I print it on our LaserWriter using the
>Sun print spooler.  It works fine under NeWS.  Any ideas?
>
>Thanks in advance...
>


	You never did a setfont.. You must do a setfont before you
	do a show.. Otherwise you get an invalid font error message.

	NeWS must handle this by loading a default font at some point.

----------------------------------------------------------------------
   __        __  /|      Curt Jutzi (Jutz)                 Tektronix Inc.
 ((__ \      \'o.O`      tektronix!curtj@pogo.WV           Del. St. 63-356
    \\ !     =(___)=     (503) 685-3723                    P.O. Box 1000 
     !!!        U                                          Wilsonville,OR 97070
 o_@@--.\   ACK! PHHT!  	 
 (___,  /