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



Years ago, I needed to right justify some text on a laser printer with a proportional font. As Scott says, there was a tool that would extract the character width which I stored in a physical file. Then, you just walked the string adding up the space and used absolute positioning (HP PCL) to tell the printer where to start the string and it ended up right justified.

Hard to believe there's no spacing table for DDS fonts but I've never researched it. Surely the print logic (under the covers) knows how wide they are.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Monday, June 27, 2011 2:29 PM
To: RPG programming on the IBM i / System i
Subject: Re: Determine size of print line with proportional fonts

On any other platform that supports fonts (Windows, X11, et al) there
are always font metric tools available that tell you how wide a string
will be in a given font.

I don't know of anything like that with printer fonts in DDS, and this
greatly annoyed me many years ago.

Sadly, I pretty much gave up and used a fixed-pitch font for that
project. In more recent projects, I've used other formats, such as HTML
or PostScript and printed things from a PC.


On 6/20/2011 10:01 AM, Tom Deskevich wrote:
I am using a print file to print names that can be a maximum length of 66 bytes.
A co-worker tells me that you can somehow know how much space a name takes up, even though the print is proportional.
He also said he did not have any more information on that, just heard you could do it.

So if the first name occupies the full line, you would test and advance to the next line.
If it does not take up the full line, you can test the next name and see if they can both fit on the same line.

THIS NAME TAKES UP THE FULL LINE OF PRINT WWWWWWWWW YES IT DOES

THIS IS A SHORTER NAME THIS IS ANOTHER SHORTER NAME

Easy when you use CPI, but I suspect my co-worker wants to make me look stupid, forever engraved in cyber space, thinking you
can somehow test how much space is used in proportional printing.

TIA

Tom Deskevich
INFOCON
814-472-6066
Fax 814-472-5019


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.