CC: Re: PCL Right Justify

Jim Asman jlasman at telus.net
Wed Apr 20 19:55:17 PDT 2011


--------------- Original Message ---------------
At 09:42A Thu Apr 21 2011, Scott wrote:

> Sorry 
> 
> Maybe I wasn't clear , I need a pcl code to right justify and proportional
> space font not a fixed space .... I am using filepro .2 field types ... but
> with the 'client requested' font it is printed from the left side.
>  
> 
> So I need to move to a pcl location then print it backwards from there.
> 

First, there is NO command in a PCL context to right justify a field.
Printer drivers typically calculate the printing with by referring to
a character width table that contains the font metrics and then determines
the necessary starting point to end at the desired position.

However, if you are printing to a proper LaserJet that can speak HP-GL/2,
and you can speak HP-GL/2, you CAN right justify a field using the
Label Origin (LO) command.

There ia a cheat, though, in the PCL context. The reason that justification
fails on numeric fields is that the character width of the space is smaller
than the numerals, typically about half. So, if there are only leading 
spaces before the first numeral, we can make it work. This precludes
a negative number with a minus sign(-) to the left of the numerals. All
we need to do is make the space width the same as the numeral width and
we can treat the field as if it were fixed pitch. If you must have negative
numbers, then have the "-" trail the numerals.

This magic is performed by a PCL command, the "horizontal motion index".
The HMI is designed to very precisely set the pitch of a fixed pitch font.
For example, if you needed to fit some text somewhere and it worked out
that your pitch needed to be 9.888 cpi, you could start out with a 10 cpi
font, apply the appropriate HMI command and you would truly get 9.888.

The HMI effectively changes the width for all characters in a fixed pitch
font. Now back to our story. When the HMI is applied to a proportional
font, ONLY the width of the space is affected. So we make the space the
same width as the numeral and go for it.

I talked about this in an article I wrote about 20 yrs ago, and that very
article should still be in the filePro online manual. Check it out on the
fpTech website.

Is the customer supplying you with a soft font or are you using one of the
printer's internal fonts?


Jim 
--
jlasman at telus.net                      Spectra Colour Services Ltd.
Jim Asman                              10221 144a Street            
Phone: (604)584-0977                   Surrey, BC  V3R 3P7   CANADA            
 Cell: (604)619-0977                   www.spectracolorservices.com



More information about the Filepro-list mailing list