Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can fonts be (affine) transformed in PCL?

Status
Not open for further replies.

Joerg2

Programmer
Aug 2, 2005
7
DE
Hello,

I am looking for a way to keep the hight of a monospaced 10 chars per inch font when changing its pitch (count) parameter to 12, 15 and 17. In Postscript this can be achieved in applying a matrix to an existing font, for example:
Code:
/Courier [10 0 0 12 0 0]

but how can this effect be achieved in PCL? Simply modifying the pitch parameter decreases both hight and width of the characters. But I have to keep the hight and only compress the width.
Any ideas?

Jörg
 
Select the font in the size that you require - for a fixed-pitch scalable font, as you have probably discovered, this is actually done by choosing a particular pitch. For example:

{esc}(19U{esc}(s0p12h0s0b4102T

for 12 characters-per-inch LetterGothic.

Then set a different pitch, by using the Set Horizontal Motion Index (HMI) escape sequence to set a different horizontal advance; for example:

{esc}&k15H

sets the advance at 15/120 inch, equivalent to 8 cpi.

This ONLY works for fixed-pitch scalable fonts; with proportionally-spaced scalable fonts, HMI only affects the space character.
 
You can do this in HP-GL/2. See the SI command.

I don't know of any way in the PCL context.

Jim Asman
 
If you were to use PCL6 (aka PCL XL) instead of PCL5, all scalable fonts can be scaled and/or skewed, in either or both horizontal and vertical axes.

But PCL6 is MUCH more difficult to manipulate, and much less widely documented than PCL5.
 
Hello DansDad and Jlasman,

thank you for your response.
DansDad, your example works fine if you want to increase the space between the characters. But since the actual character size is not modified at all, overprinting happens when decreasing the space.

Jlasman, yes, with the SI-command of HP-GL it works. Only the size values in cm are somewhat strange to me.
If somebody is interested, for a standard 10 cpi or 12 point font I would have expected the character width to be 0.25 (1 inch = 2.5 cm), but by means of trial and error I found out it is 0.212 (and 0.3 for the height).

Thanks, once again

Jörg
 
At 12 cpi the advance from character cell to character cell is .25 in. The actual width of ther character is necessarily something smaller to allow for some intercharacter spacing. Obviously, an "I" will be narrower than a "W" even though the character advance is the same for both.

The actual height of the characters will be dependent on the font design; e.g., Letter Gothic characters are taller than Courier characters at a given pitch.


Jim Asman
 
To add to Jim's point regarding height/pitch ratios:

With Courier, the aspect ratio is approximately 60%; to put it another way:

pitch (characters-per-inch) * height (points) = 120

With LetterGothic, the aspect ratio is approximately 50% (or cpi*pts=144).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top