Gary,
>After further investigation, the hpUnits function sets [I]nches [R]ows or
>[M]illimeters. Then a call to something like hpcenter(x,y,txt) or
>hpatsay(x,y,txt) always generates the same hp sequence with the x,y
>coordinates internally converted to decipoints.
That makes a lot of sense
>The typical sequence is a
>push the cursor position, set the vertical and horizontal position (in
>decipoints), print the text, and then pop the cursor position.
Ditto. One additional little trick that I use at the top of the page
is to push the cursor, move to an absolute X,Y position that gives me
the margins I want, push the cursor again and then do the kind of
sequences you mention (using relative positioning from X,Y, not
absolute from 0,0). That gives me an easy way to "move the whole cake
around on the plate" if I need to do that at a later time.
>I'll have to
>write the center function based on the font size, page width... and make
the
>unit of measure to decipoint conversions. I didn't really want to do all
of
>this, but I don't see an alternative if I don't want to change all of my
>print a laser form code.
That shouldn't be a giant project, should it? Do you use both fixed
and pro****tional fonts or just fixed? For pro****tional fonts you will
need a font width table, but at least the Adobe ones for Helvetica and
Times are easy to get, provided that you are satisfied with them being
"close enough" to be applied to the built-in fonts in the printer.
What about separating text measuring from text positioning? You might
want right alignment as well as centering, sizing a box around some
text, etc. Then let all those functions call a common measuring
function.
>A simple replace of a call to hpAtSay with a
>rewritten pclAtSay still seems like the best route. What do you think?
Yes, absolutely. The time you spend now replicating the existing
functions as closely as possible will pay off in the long run when all
you have to do is call the new function and get the same result you
are used to from the Esc40 library. If this was my project I would
even consider keeping the function names.
BTW, I suppose you are doing all this as a preparation for breaking
out of the 16-bit world?
>Thanks again for your time,
No problem. Let me know if there is anything else I can do to help you
with the migration.
Regards,
Klas
-------
klas dot engwall at engwall dot com
http://www.engwall.com/clipper/
The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit


|