Using Custom Font Metric Files

The AFP2PDF Plus Transform can be configured with custom font metric files to control the placement of individual characters and to aid in text alignment. The transform uses the default fonts available in the PDF display application (for example, Adobe Acrobat) and applies special character widths as specified in the font metric file.

Font metric files should be set up to use the default PDF WinANSI encoding (code page 1252). They cannot be used for double-byte text (Asian languages). The files are located in the \font\Type1 subdirectory and are named Custom-Metrics-xx.met, where xx is 1 to 99.

To configure the transform, specify the name of the font metric file as the first parameter in the alias.fnt file. Set the second parameter, specifying the Adobe Font Metric (AFM) file name, to NULL.

Custom Font Metric files Defined in the alias.fnt File shows an example of the alias.fnt file with entries that define custom font metric files to the transform.

Custom Font Metric files Defined in the alias.fnt File

;**** Requested font=font name,Font metric/AFM file name (or
'NULL' for not used) *****
;******* End User-defined/Custom names *******

The format of custom font metric files follows the AFM specification, including these additional parameters that describe the font used for the display:

Specifies various characteristics of the font. Values for the Flags Parameter shows the allowable values.

Values for the Flags Parameter

Typeface Flag
Courier—Serif Fixed Pitch 35
Courier Bold 262179
Courier Italic 99
Courier Bold Italic 262243
Helvetica (Arial)—Sans Serif Proportional 32
Helvetica Bold 262176
Helvetica Italic 96
Helvetica Bold Italic 262240
Sans Serif Fixed Pitch 33
Sans Serif Bold Fixed Pitch 262177
Sans Serif Italic Fixed Pitch 97
Sans Serif Bold Italic Fixed Pitch 262241
Times New Roman—Serif Proportional 34
Times New Roman Bold 262178
Times New Roman Italic 98
Times New Roman Bold Italic 262242
Specifies the width, measured in the x direction, of the dominant vertical stems of characters in the font.

In practical terms, StemV represents the weight or boldness of the font. A typical medium weight font has a value of 80. For a light font, the value might be in the 65–70 range. A bold font might have a value of 120. In all cases, use these values as a starting point. Adjust the StemV value to get the output PDF file to look like the original printed output.

Specifies the angle, in degrees counterclockwise from the vertical, of the dominant vertical strokes of the font. Typically, this value is in the range of -10 to -15. Adjust as necessary to get the output PDF file to look like the original printed output.

Example of a Custom Font Metric File shows an example of a custom metric file called Custom-Metrics-1.met.

Example of a Custom Font Metric File

; Description - 'Custom Font 1'
Ascender 924
CapHeight 720
Descender -216
Flags 32
FontBBox -47 -204 996 924
ItalicAngle 0
StemV 90
XHeight 720
C 32 ; WX 240 ; N space ;
C 33 ; WX 252 ; N exclam ;
C 34 ; WX 408 ; N quotedbl ;
C 35 ; WX 480 ; N numbersign ;
C 36 ; WX 480 ; N dollar ;
C 37 ; WX 756 ; N percent ;
C 38 ; WX 552 ; N ampersand ; 
C 39 ; WX 240 ; N quotesingle ;