× 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.



Yep. I feel your pain, Mark. It's very hard to get any sort of text metrics (font width, height, string length, etc.) when working with printing on the i.

With CPI/LPI, I tend to just hard-code it. That means that if I change my print file, I'll have to modify my program as well... ugly, I know, but it's what I do.

What's even worse is when using fonts in AFP. I don't mean the fixed-width LPI/CPI fonts, but rather the proportional ones. There's absolutely way to get font metrics about height and width. On other platforms there are extensive libraries of routines to give you information about this sort of thing, but on i you're pretty much S.O.L. unless you can hard-code the positions of everything.


M. Lazarus wrote:
Scott,

I did bite the bullet and go to the LINE keyword in AFPDS.

One drawback is that you need to provide the positioning in units of measure (either in. or cm) instead of it defaulting to the current line. So, to be truly generic, I would need to know CPI, LPI, the current line and possibly the defined margins, to place it accurately.

It would be really nice if the UNDERLINE keyword would accept some optional parms, like line style (dashes, double, triple, etc.) and thickness.

I looked a few times for info on retrieving the CPI and LPI values, but didn't find them in the INFDS. Are those in there and I just missed them? Or is an API required? I'm looking for the current values of the open printer file, not to retrieve them from the *PRTF object.

-mark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.