PCL Right Justify
Bob Rasmussen
ras at anzio.com
Fri Apr 22 11:31:03 PDT 2011
Here's another wrinkle on this topic:
Columns of numbers don't benefit much by being in a proportionally-spaced
font. In fact, in most (all?) fonts the digits 0 to 9 are all the same
width. So why not print alpha fields in a proportional font, but keep the
numeric fields in Courier?
On Fri, 22 Apr 2011, Jim Asman wrote:
> George,
>
> I apologize, you are absolutely correct. As there the number of ","
> changes, depending on value, we can't guarantee alignment.
>
> In that case, we would have to measure each field beforehand to determine
> the appropriate print position.
>
> But then, I don't deal with numbers that need a comma. ;-)
>
>
> > --------------- Original Message ---------------
> > At 10:38A Fri Apr 22 2011, Jim Asman wrote:
> >
> > > No. That doesn't change anything in terms of alignment. In fact, the
> > > character widths of ; : , . are all the same in most, if not all, LJ
> > > fonts.
> > >
> > > Besides, we aren't really concerned with the absolute printing width of
> > > the field, just that the width is consistent, regardless of the value it
> > > contains. So if instead of a "." or a "," we had a "&" as the alignment
> > > character, the field width would be a little wider but it would still be
> > > consistent with different values.
> > >
> > > The "-" sign on a negative number is only an issue because it normally is
> > > displayed just BEFORE the first numeral.
> > >
> > >
> > >
> > > --------------- Original Message ---------------
> > > At 10:20A Fri Apr 22 2011, flowersoft at compuserve.com wrote:
> > >
> > > > One thing Jim forgot to say (I think) is that this only works if the
> field
> > > > has a .2 (or .3 or .4 etc.) edit but not with a ,2 edit.
> > > >
> > > > -----Original Message-----
> > > > From: filepro-list-bounces+flowersoft=compuserve.com at lists.celestial.com
> > > >
> > [mailto:filepro-list-bounces+flowersoft=compuserve.com at lists.celestial.com]
> > > > On Behalf Of Jim Asman
> > > > Sent: Wednesday, April 20, 2011 10:55 PM
> > > > To: scott.filepro at aanet.com.au
> > > > Cc: filepro-list at lists.celestial.com
> > > > Subject: CC: Re: PCL Right Justify
> > > >
> > > > --------------- 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
> > > >
> > > > _______________________________________________
> > > > Filepro-list mailing list
> > > > Filepro-list at lists.celestial.com
> > > > Subscribe/Unsubscribe/Subscription Changes
> > > > http://mailman.celestial.com/mailman/listinfo/filepro-list
> > > >
> > >
> > >
> > > 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
> > >
> > > _______________________________________________
> > > Filepro-list mailing list
> > > Filepro-list at lists.celestial.com
> > > Subscribe/Unsubscribe/Subscription Changes
> > > http://mailman.celestial.com/mailman/listinfo/filepro-list
> >
> >
> > 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
> >
>
>
> 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
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
Regards,
....Bob Rasmussen, President, Rasmussen Software, Inc.
personal e-mail: ras at anzio.com
company e-mail: rsi at anzio.com
voice: (US) 503-624-0360 (9:00-6:00 Pacific Time)
fax: (US) 503-624-0760
web: http://www.anzio.com
street address: Rasmussen Software, Inc.
10240 SW Nimbus, Suite L9
Portland, OR 97223 USA
More information about the Filepro-list
mailing list