Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text-wrapping in PostScript?

Status
Not open for further replies.

makaveliuk

Programmer
Dec 1, 2003
46
GB
I am working on a project to create postscript from a data file, it's working ok for adding images and single-lines of text but I cannot work out how to make text wrap, is it possible?
 
Thanks for the reply, I'm very new to writing PostScript and after a lot of searching and trying things I cannot work out how to do it, could you point me in the right direction?

TIA
 
You'll have to write a procedure. That procedure will process a string. For each word in the string, you will use the "stringwidth" operator to measure the word. You will add the x-dimension of the string to your "currentpoint". You will compare that with your margin. If the word would exceed the margin, you'll use a "moveto" to reposition your currentpoint to the start of a new line.

I would suggest that you study these operators:

currentpoint
moveto
stringwidth
search



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
PostScript interpreter doesn't have any access to kerning pairs. So the sophisticated formatting is not possible. Try to do the formatting on the host.

PostScript is also about 100 times slower than C.

Your PostScript expert is just a click away.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top