Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Postscript Show Text on different lines

Community Beginner ,
Feb 29, 2008 Feb 29, 2008
Hi,

I am a postscript newbie and I hope that this is not a stupid question . I hope this is a right forum. I am trying to wrap text on different lines. For example, if I have a text

"Karthik Krishnan \n 847 N 700 E , \n Logan, UT 84321\n", I would like it to appear on different lines. It keeps appearing on the same line. This is a syntax that I have

/Arial findfont 10 scalefont setfont
10 70 moveto ("Karthik Krishnan \n 847 N 700 E , \n Logan, UT 84321\n") show

always returns the text on the same line. Please help me.
TOPICS
Programming
2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 01, 2008 Mar 01, 2008
There is absolutely no feature in PostScript that works the way you
want it. You cannot put line breaks into strings. You must set each
string separately.

Aandi Inston
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 01, 2008 Mar 01, 2008
How do I set out each string separately? Can I search for \n characters for the same
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 02, 2008 Mar 02, 2008
You use a moveto before each string, each time changing the vertical
start position to where you decide a new line belongs.

It's possible to use the search operator in PostScript to split up
strings, but this is hard work and rarely done: such calculations
belong in the PostScript generator.

Aandi Inston
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2008 Mar 26, 2008
LATEST
You can take a look at Program 12 / A Simple Line Breaking Algorithm, page 181 in the blue book: PostScript Language Tutorial & Cookbook. It may or may not help you.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines