Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!birdland!rberlin From: rberlin@birdland.eng.sun.com (Rich Berlin) Newsgroups: comp.lang.postscript Subject: Re: postscript back-slash escapes Message-ID: <6173@exodus.Eng.Sun.COM> Date: 17 Jan 91 18:50:25 GMT References: <663@ast.dsd.northrop.com> Sender: news@exodus.Eng.Sun.COM Reply-To: rberlin@eng.sun.com Organization: Sun Microsystems Lines: 51 cc: paynter@ast.dsd.northrop.com (paynter ann m.) Ann: The short answer to your question is that \n, \r etc. are not the way to render multiple lines in PostScript. If you need output that looks like this you need to position each line with its own moveto, e.g. 200 200 moveto (looks) show 200 180 moveto (like) show 200 160 moveto (this) show The escapes actually *do* work in the sense that the characters they describe end up in the string. If your printer and your computer have a bi-directional link, you can see what I mean: rather than rendering a string onto the page, you send them back from the printer to the computer along the i/o channel. If you do (one line) print (another line) print what will come back is one lineanother line while if you do (one line\nanother line) print what will come back is one line another line. ------ If you read up on how "show" works, you'll see that when it encounters the \n in the string, it looks up the character encoded by \n and comes up empty-handed; what I think is likely is that in the encoding vector for most fonts, slot #10 (integer value of ascii newline) contains ".notdef". I don't really have time to explain this in detail, so pardon me for referring you to the manual for a more complete explanation. In the 1st ed. redbook, Read section 5.4, beginning on page 93. -- Rich