[comp.lang.postscript] Help needed

morrow@murdu.OZ (Christopher Morrow) (01/26/89)

I have been trying to learn some postscript from the Postscript
Cookbook and tutorial (blue).  I was trying to use the circular text example 
towards the end of the book.  I cannot get it to go.  Has any one else
had this problem.  I have tried on Laserwriters NTX II from Unix
bsd4.3 and with atp on a Mac plus.

Attached is my file
I donot think that I have infringed copyright as it does not
work and therefore must be different from that presented in
the book.  The error is not clear with nothing usually emerging from
the printer.
%>lpr -v -Plw file
Please mail me direct as I donot usually read this news group.
-----------------------------------------------------------
/outsidecircletext
 { circtextdict begin
    /radius exch def
    /centerangle exch def
    /ptsize exch def
    /str exch def
    /xradius radius ptsize 4 div add def

  gsave
    centerangle str findhalfangle add rotate

  str
    {/charcode exch def
      () dup 0 charcode put outsideplacechar
    } forall
  grestore
 end
} def

/insidecircletext
  { circtextdict begin
     /radius exch def   /centerangle exch def
     /ptsize exch def   /str exch def
   
     /xradius radius ptsize 3 div sub def
     gsave
       centerangle str findhalfangle sub rotate
       str
        {/charcode exch def
         () dup 0 charcode put insideplacechar
        } forall
     grestore
   end
} def

/circtextdict 16 dict def
circtextdict begin
  /findhalfangle
    { stringwidth pop 2 div
       2 xradius mul pi mul div 360 mul
    } def

/outsideplacechar
  {/char exch def
   /halfangle char findhalfangle def
     gsave
      halfangle neg rotate
      radius 0 translate
      -90 rotate
      char stringwidth pop 2 div neg 0 moveto
      char show
   grestore
   halfangle 2 mul neg rotate
 } def

/insideplacechar
 {/char exch def
  /halfangle char findhalfangle def
  gsave
   halfangle rotate
   radius 0 translate
   90 rotate
   char stringwidth pop 2 div neg 0 moveto
   char show
  grestore
  halfangle 2 mul rotate
 } def

 /pi 3.1415923 def
end

/Times-Bold findfont 22 scalefont setfont

306 448 translate

(Symphony No. 9 (The Choral Symphony))
  22 90 140 outsidecircletext

/Times-Roman findfont 15 scalefont setfont
(Ludwig von Beethoven)
  15 90 118 outsidecircletext

(The New York Philharmonic Orchestra)
  15 270 118 insidecircletext

showpage

jos@idca.tds.PHILIPS.nl (Jos Vos) (02/01/89)

In article <1511@murdu.OZ> morrow@murdu.OZ (Christopher Morrow) writes:

>I have been trying to learn some postscript from the Postscript
>Cookbook and tutorial (blue).  I was trying to use the circular text example 
>towards the end of the book.  I cannot get it to go.  ...

It's quite simple: because the code is showed in a proportional font
(which should never be done) you did read the "( )" as "()".
If you know a little bit more of PostScript (I don't blame you! - the book
is just for people that want to learn it) you will read it automatically
as "( )" because of the statements behind it.

>         () dup 0 charcode put insideplacechar
For example...
(It appears a few times in the text, I think.)

Have fun.

-- 
-- ######   Jos Vos   ######   Internet   jos@idca.tds.philips.nl   ######
-- ######             ######   UUCP         ...!mcvax!philapd!jos   ######