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

Centering Text

New Here ,
Jan 23, 2009 Jan 23, 2009

Copy link to clipboard

Copied

Is there a way to code the line so it will center on the page without my recalculating the values (161.88 is the horizontal position of the moveto obviously) This particular line was origionally generated with Quark 3 and I use some moveto operators similar to this in my application. The vertical must be 410.05 as this text is 'envelope' sensitive.

161.88 410.05 m .5 5 24 175.25 (Certificate of Coverage)d

Thanks TGW
TOPICS
Programming

Views

2.3K

Translate

Translate

Report

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 ,
Jan 23, 2009 Jan 23, 2009

Copy link to clipboard

Copied

LATEST
Hi,

Here is a routine I have used to center text horizontally on a given x, y location:

/center { % x y string
/string exch def
/y exch def
/x exch def

0 0 moveto
string dup stringwidth pop
2 div
x exch sub
y moveto
show
} def

I hope this helps you,

Johann

Votes

Translate

Translate

Report

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