Because PostScript fonts are scalable, the PFM files for the PostScript fonts do not contain width tables. The files have the following form:
PFMHEADER Header; /* font header */
PFMEXTENSION Extensions; /* extensions */
char DeviceName[]; /* printer device name */
char FaceName[]; /* font face name */
EXTTEXTMETRIC ExtTextMetrics; /* extended text metrics */
WORD ExtentTable[]; /* unscaled character widths */
DRIVERINFO DriverInfo; /* driver-specific information */
PAIRKERN KerningPairs[]; /* pair-kerning table (optional)*/
KERNTRACK KerningTracks[]; /* track-kerning table (optional)*/
The PostScript driver for Windows assumes all PostScript fonts are scalable fonts, so it ignores the dfPoints and dfPixHeight members in the PFM header. The members dfAvgWidth and dfMaxWidth are in units of 1000 units-per-em.
Although the PostScript naming convention includes the attributes of the font (that is, bold and italic) in the font name, the attributes should be stripped from the font name and represented in the dfWeight and dfItalic members in the PFM header.
The extent table is an array of 16-bit values containing the unscaled widths
of the characters and assuming 1000 units-per-em. The range of the table
should be from dfFirstChar to dfLastChar. The size of the table should be
dfLastChar – dfFirstChar + 1.
Pair-kern values should be in the same 1000 units-per-em measurement as the extents. As of this writing, we do not know of any application that uses the track-kern table.
In the EXTTEXTMETRIC structure, the PostScript driver assumes the following values for each font:
dfVertRes = 300
etmMasterHeight = 300
etmMasterUnits = 1000
In other words, the driver assumes all fonts use Adobe's standard 1000
units-per-em method for describing a font. You must build the extent table
based upon 1000 units-per-em to be consistent with this restriction in the
driver.
The driver also assumes that the font may be scaled to any point size the application requests. We recommend that the true scaling range of the font be indicated in the etmMinScale and etmMaxScale members (in device units, at 300 dpi). The driver currently ignores these members.
Because the Windows PostScript driver assumes all PostScript fonts are scalable fonts, it ignores the etmPointSize member. The etmSize member is not the point size, but rather the size (that is, the number of bytes) of the EXTTEXTMETRIC structure.
As of this writing, we do not know of any application that uses the members in the EXTTEXTMETRIC structure except for etmKernPairs. If your font contains kern pairs, you must fill in the EXTTEXTMETRIC structure to indicate the number of kern pairs. Do not leave the other members blank; fill them in with reasonable values in the event an application does use them.
The driver-specific data structure pointed to by dfDriverInfo is a null-terminated string containing the PostScript name for the font. There are two names for the font:
The Windows name for the font which appears in the font list in the application's font dialog box.
The PostScript name for the font, which can vary according to printer manufacturer and which the driver sends to the printer to select the font.
Both strings must be null-terminated. The Windows name for the font is pointed to by dfFace and the PostScript name for the font is pointed to by dfDriverInfo.
To create a PFM file for the internally-supported printers, Microsoft converts Font Metric (AFM) files to the PFM file format. These files, provided with the DDK, are ASCII files that define the metrics for each font. There are 63 AFM files supporting 63 unique fonts. Printers with resident fonts that are not supported in the current version of the driver will need to define those files as soft fonts.
If you need to define a font that is not available currently in the PostScript printer driver, you will need to modify the driver sources to add additional AFM files. Please refer to the PostScript driver's MAKE file that is included on the DDK disks for more information on how the driver builds AFM and PFM files.