Scalefont – AMT Datasouth PAL User Manual
Page 171

165
scalefont
scalefont
Description
Modifies a font dictionary to scale the characters to a desired height.
Usage
AnyFontDict ScaleNum
scalefont
ScaledFontDict
AnyFontDict
Dictionary. Font dictionary returned by the findfont operator.
ScaleNum
Integer or fixed-point. Factor by which to scale characters of the font.
ScaledFontDict Dictionary. AnyFontDict modified to scale the font's characters to the desired
height. PAL modifies AnyFontDict. It does not create a new dictionary.
Comments
The font dictionary returned by the findfont operator contains information designed to scale the
characters of the font to one user coordinate tall. The scalefont operator modifies the font dic-
tionary to draw characters of any desired height.
The font dictionary contains only relative character scaling information. PAL combines the font's
scaling information with the current user scaling factor to determine the true size of the characters.
PAL combines this information when it draws the characters.
Since fonts default to one user coordinate tall, and the user coordinate system defaults to one point
scaling, each character defaults to a height of one point. However, changing the user coordinate
scaling factor will accordingly change the default character height. For example, changing the user
coordinate system to inches changes the default character height to one inch.
The scalefont operator allows the programmer to compensate for the current user coordinate sys-
tem scaling as well as establish any desired height for the characters. Under the default coordinate
scaling of points, the "AnyFontDict 12 scalefont" operation will configure the font information to
draw 12 point characters. However, the same scalefont operation with a user coordinate system
based on inches would produce 12 inch tall characters. Therefore, with a user coordinate system
based on inches, "AnyFontDict 12 72 div scalefont" will configure the font information to draw
12 point characters.
Hints
PAL does not automatically scale all the characters of a font in response to the scalefont operator.
Since character scaling takes time, PAL waits to scale each character until it needs to draw the
character onto a page. PAL also rotates the characters at this time to match the orientation at which
it must draw the characters.
Once PAL scales and rotates a character, it places the character image into a character cache. This
allows PAL to use the already scaled character image if PAL must draw the character again.
PAL keeps the scaled and rotated character images in a special private area of ScaledFontDict.
So long as a reference to ScaledFontDict exists within the printer's memory, PAL will retain the
characters it has already scaled and rotated.