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


  • Subject: Re: WSCST and Horizontal Motion Index
  • From: dhandy@xxxxxxxxxxx (Douglas Handy)
  • Date: Mon, 15 May 2000 20:09:50 -0400

Brad,

>Anyone know where to place the HMI (Horizontal Motion Index) in a WSCST?
>This question is for someone else... hope it isn't too vague.

I haven't had a need (yet) to use a WSCST object.  But I can explain
what HMI is and point you in the right direction.  I've used HMI since
S/36 session printer emulation days to achieve 198 columns landscape
with printer resident fonts.

HMI is a PCL command to override a fixed-pitch font's normal character
width.  The HMI is nothing more than the distance (width) a PCL
printer will increment the logical page position for each character in
a fixed-pitch font.   When you select a font in PCL, it changes the
default HMI value based on the font.  EG, a 10cpi font gets the HMI
set to 1/10 inch, etc.  (For proportional fonts, I believe the HMI
just alters the width of the space character.)

By sending a HMI command *after* setting the desired font, you can
tweak this value to suit your needs.  (It must be sent after the font
command since selecting a font changes the HMI too.)  In normal use,
you only want to tweak the HMI in small amounts from the font's
default width.  

When you change the HMI, the size of each character doesn't change,
just the distance to the next character.  Double the HMI and it will
look like you've put a space between each character.  Cut the HMI in
half and the characters will overlap each other halfway -- a very
unreadable proposition.

However, by *slightly* squeezing a 17-cpi font's HMI, you can get a
full 198 print positions in the space normally taken for somewhat
fewer columns.  The characters are closer together, but if you keep
the HMI adjustment reasonable you can avoid actual overlap.

For the sake of discussion, let's say you had a 10.5 inch printable
area, and you wanted to squeeze 198 columns into it.  You therefore
want a CPI of 198 / 10.5 = 18.85 CPI.  Further assume the closest
resident font in your printer is 16.66 CPI.  You would then send the
PCL for selecting the 16.66 CPI, followed by the PCL to set the HMI
value to 18.85 CPI. 

The PCL command to set the HMI is <esc>&k#H where # is a number in the
range of 0-32767, valid to four decimal positions.  The number is in
1/120 inch increments.  Therefore, you compute the value as 120
divided by the desired CPI.  In our example, it is 120 / 18.85 which
equals 6.3660477... which gives us an escape sequence of <esc>&k6.366H

This works the other way too.  Say you had a 20 CPI font.  This could
leave you a wide right margin.  So you could select the 20CPI font
then still override the HMI to increase the width taken for each
column so that you get a nicely spaced report.

Now back to the WSCST.  As I said, I haven't used these (yet).  But
glancing at my softcopy, I'd say what you need to do is change the
:CPICOR tag with the CPI=15 value.  You probably need to change the
FNTWTH value to the closest value you can get to your desired HMI
override.  FNTWTH is less precise then HMI.  Continuing our example, a
18.85CPI would be 1440 / 18.85 = 76.3925 which you need to round to
76. My guess is  Host Print Transform probably uses this value to keep
track of where it thinks you are on the page.  If we didn't decrease
this value but left it at 84 or so, HPT may think we don't have room
for all 198 columns and truncate the text which is sent to the
printer.  IOW, it may be better to have this value too small than too
large.

The DATA tag would need to be overridden from ''X to the specific
escape sequence to first select your desired resident font then set
the desired HMI value.

I like to use the PCL command to select a font by CPI value rather
than naming a specific font.  That way if you get a font cartridge
with a different font, a downloaded softfont, or a scaleable fixed
pitch font you automagically get a properly sized font selected.

This PCL command is <esc>(s#H where # is the desired CPI valid to two
decimal positions.  EG, <esc>(s18.85H will request a 18.85CPI font.
Assuming it does not exist (nor a scaleable fixed pitch font), the
printer will select the next greater available pitch, if any.  If that
does not exist, it will select the closest pitch (e.g. 16.66 CPI).

So combining <esc>(s18.85H and <esc>&k6.336H we get:

  DATA = '1B287331382E3835481B266B362E33333648'X

So, that gives us something like this in the WSCST:

     :CPICOR
      CPI=15
      ASCIIFNT=254
      FNTWTH=76
      FNTATR=1
      DATA= '1B287331382E3835481B266B362E33333648'X

assuming you are using COR mode.  Otherwise use just :CPI instead of
:CPICOR as the initial tag.

Disclaimer:  I have never used a WSCST, and this comes to you
untested.  But I have played with a number of different data streams
over the years, including 5250 and PCL.  Tweaking the HMI value is one
of the tricks I've used over the years to get 198 print positions from
standard fonts.
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.