Path: utzoo!utgpu!attcan!uunet!lll-winken!ames!xanth!mcnc!gatech!mcdchg!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.lang.postscript Subject: Re: How can I fill text? Summary: or the reverse Message-ID: <7544@chinet.chi.il.us> Date: 27 Jan 89 04:13:32 GMT References: <2200001@hpcilzb.HP.COM> <13957@ico.ISC.COM> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Public Access Unix Lines: 27 In article <13957@ico.ISC.COM> rcd@ico.ISC.COM (Dick Dunn) writes: >In article <2200001@hpcilzb.HP.COM>, cnc@hpcilzb.HP.COM (Chris Christensen) writes: >> Does anyone have a sample of postscript function to fit a string to a box >> of a given size? What I want is for the string to start a new line before >> it goes outside of the box.. >Someone already posted the reference to the Adobe-published example. >However, it's probably worth an aside that if you're writing something that >will see a lot of production use, you'd be better off doing the calculation >in the host computer before you send it to the printer--not everything that >*can* be done in PostScript *should* be done there. It can make a differ- >ence in printing speed. The problem with processing in the computer is that the computer has to know all the character sizes of every font that can be used. The printer has to know this in any case. Of course if the computer is going to attempt to give a screen preview then it has to have the font data for that. I recently needed to print nametags on a postscript printer and couldn't find any software that would take an arbitrary length string and make it fit into a fixed amount of space by scaling the font from a set maximum down to whatever it takes to make it fit. I ended up writing a perl script that would take a list of names and generate a postscript program. Is there a better way? Les Mikesell