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



Surely the print logic (under the covers) knows how wide they are.

Why would the qspl stuff need to know the width - it probably sends it all to the printer & depending on printer settings it wraps or cuts it off at the margin.
This article (from 1999), describes the complexity of such a calc
http://www.pcmag.com/article2/0,2817,1160227,00.asp
Every point size of every font character for every font (plus attributes like bold, italic) would have to in be retreivable or in some way calculated (or an OS api would be needed).
If you are doing all the print in a single font, you could approximate a table yourself with a little work and a fine ruler.
I've not looked, but check out the older manual Printer Device Programming
manual - it has reference to other nonAS400 manuals about how fonts are built.
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/books/sc415713.pdf
If you do find a solution, please post it.
Jim Franz

----- Original Message ----- From: "Harman, Roger" <Roger.Harman@xxxxxxxxxx>
To: "'RPG programming on the IBM i / System i'" <rpg400-l@xxxxxxxxxxxx>
Sent: Monday, June 27, 2011 6:08 PM
Subject: RE: Determine size of print line with proportional fonts


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

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.