Currently, the PCL driver for Windows supports only nonscaling PCL fonts. The driver will detect scalable fonts by examining the etmMinScale and etmMaxScale members in the EXTTEXTMETRIC structure. If they are equal, it will assume a nonscaling font.
A PFM file for scalable PCL font must have the following form:
PFMHEADER Header; /* font header */
WORD WidthTable[]; /* variable-width fonts only */
PFMEXTENSION Extensions; /* extensions */
char DeviceName[]; /* printer device name */
char FaceName[]; /* font face name */
EXTTEXTMETRIC ExtTextMetrics; /* extended text metrics (optional)*/
WORD ExtentTable[]; /* unscaled character widths */
DRIVERINFO DriverInfo; /* driver-specific info (optional)*/
PAIRKERN KerningPairs[]; /* pair-kerning table (optional) */
KERNTRACK KerningTracks[]; /* track-kerning table (optional) */
In the PFMHEADER structure, the dfPixHeight member must contain the height of a default font size (same as 12 points).
For variable-width fonts, the width-table array contains widths for the default point size.
In the DRIVERINFO structure, the epEscape member must be nonzero (that is, a printer escape must be provided).
Optionally, pair-kern and track-kern tables may be provided. The default font size and width table should be provided for consistency with the existing driver. If they differ and the dfExtMetricsOffset member is not NULL, the driver will assume a scalable font.
An extent table must be supplied for scalable fonts. The extent table is an array of words containing the unscaled widths of the characters. The range of the table should be from dfFirstChar to dfLastChar. The size of the table should be dfLastChar – dfFirstChar + 1 word. The driver will scale the characters using the formulas based on the etmMasterHeight and etmMasterUnits members.
The driver will not support the ENABLERELATIVEWIDTHS escape, as this would be difficult to support with scaling and nonscaling fonts intermixed (scaling fonts use font units; nonscaling fonts use device units).
The driver will assume the dfVertRes member equals 300 dpi. Remember that etmMasterHeight, etmMinScale, and etmMaxScale must be expressed in device units.
If the intended printer does not force its widths to 300 dpi units (that is, etmMasterUnits does not equal etmMasterHeight), the driver will attempt to cor-rect for roundoff error between the printer's units and the driver's imposed 300 dpi units. The driver will correct for the error by maintaining a running roundoff value during output of a single line of text.
You must provide the driver-specific data structure. As described earlier,
the symbolSet member of xtbl member must be equal to epsymRoman8,
epsymUSASCII, epsymECMA94, epsymGENERIC8, or epsymGENERIC7. Use an inverse translation of the tables provided in the TRANS.H file to build the extent table if you select epsymRoman8, epsymUSASCII, or epsymECMA94.
You must also provide an escape string pointed to by the epEscape member in the driver-specific data structure. The driver will send this escape to the printer to select the font.
If pair or track kerns exist, they should use the same units as the character widths in the extent table.