× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I thought there were some kind of width tables on the i - vague memory of digging around once.

----- Original Message -----
On 9/5/2013 4:28 PM, Roger Harman wrote:
A colleague is asking me how to center a variable length text field on a form using font 5707. It's an office name and varies during the print run.

I've done this years ago with HP fonts by building a width table and using absolute positioning with PCL.

That's going to be quite precise. Does your office name need to be
centred to a tenth of an inch? Sometimes it helps to nail down how much
effort to expend...

I've not used AFP much except for drawing forms. How do you deal with variable or relative text postioning this using AFP and proportional fonts?

A first approximation is to divide the length in half and position that
way via POSITION(). Some names will be more skewed than others. If
that's not good enough, you can always go the route of building a custom
width table and doing that calculation. But with AFP there's a third
way: Make the office name an image file as wide as the paper. Centre
the name within the image and print it at position 1 via PAGSEG. Be
advised that PAGSEG won't rotate, so if the page is rotated you'll need
a rotated image.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.