home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 8 / 08.iso / d / d026 / 19.ddi / PFK31.TXT < prev    next >
Encoding:
Text File  |  1992-03-14  |  172.7 KB  |  4,178 lines

  1. Introduction
  2.  
  3. The Microsoft Windows Printers and Fonts Kit explains how to create files
  4. that support the installation and use of printer and screen fonts for
  5. Windows-based drivers. This book is intended to be used by:
  6.  
  7. o   Third-party font vendors who develop fonts for Hewlett-Packard Printer
  8.     Control Language (PCL), Adobe PostScript(R), and other printers.
  9.  
  10. o   Cartridge manufacturers for printers that use PCL.
  11.  
  12. o   Printer manufacturers who have printers that support downloadable fonts
  13.     or cartridges, and who want to make the font installation of their
  14.     respective drivers consistent with other drivers.
  15.  
  16.  
  17. Printer and Screen Fonts
  18.  
  19. The advances in desktop publishing and other computer endeavors have led to
  20. an increase in the variety and quality of fonts available for printers. At
  21. the same time, the need for quality screen fonts has grown and users expect
  22. a reasonable approximation on the screen of what they plan to print. Since
  23. the fonts used to print a document are rarely the same as the fonts used to
  24. display the document on the screen, font vendors must supply screen fonts
  25. that complement their printer fonts and information files that accurately
  26. define the metrics (size and shape) of the printer fonts. When a user
  27. installs the screen fonts and the metrics files, Microsoft(R) Windows(TM)
  28. application can take advantage of the fonts to generate the best possible
  29. WYSIWYG (what you see is what you get) display.
  30.  
  31.  
  32. Windows Font Requirements
  33.  
  34. To ensure Windows applications can generate the best possible output, the
  35. Windows environment must ultimately receive the following items for each
  36. font:
  37.  
  38. o   The printer font, given as a printer-resident font, a downloadable
  39.     font, or a cartridge.
  40.  
  41. o   A screen-font file in Windows .FON file format. The font must provide a
  42.     reasonable approximation of the printer font while matching the aspect
  43.     ratio of the display device.
  44.  
  45. o   A Printer Font Metrics (PFM) file or a Printer Cartridge Metrics (PCM)
  46.     file suitable for the given Windows printer driver. The files must
  47.     contain the metrics for the printer font, including font face,
  48.     character widths, and pair- and track-kerning information.
  49.  
  50. The font vendor must make provisions to update the Windows initialization
  51. file, WIN.INI, to make the display and printer drivers recognize these
  52. fonts. Ideally, the printer driver will contain an installation program
  53. that will read the font vendor's floppy disks, and install these files. In
  54. the absence of such a utility, the font vendor should provide a
  55. user-friendly installation program. Although Control Panel can install
  56. screen fonts, installation of printer fonts and metrics files is too
  57. specific for each device to allow for a generic installation program in
  58. Windows.
  59.  
  60.  
  61. Downloadable Fonts
  62.  
  63. Downloadable fonts (also called soft fonts) are the most cost-effective way
  64. to distribute additional fonts for a printer device. This approach enables
  65. third-party vendors to create and distribute downloadable soft fonts for a
  66. device. Downloadable fonts also enable users to access a larger variety of
  67. fonts than could be held in their printer's memory. This is possible
  68. because the driver selectively downloads the fonts only when needed.
  69.  
  70. Each downloadable font must have a font file in printer-specific format.
  71. This file is in the printer's font-command language. For the Windows
  72. printer driver to download the file, it must know where the file resides on
  73. the user's hard drive. Many Windows printer drivers use softfont settings
  74. in the WIN.INI file to determine the font file locations.
  75.  
  76.  
  77. Bitmap Screen Fonts
  78.  
  79. Font vendors should create bitmap screen fonts to accompany their printer
  80. fonts. Screen fonts should be created for the aspect ratios of each of the
  81. popular display device classes. Minimally, a vendor should supply line
  82. sizes that match the frequently used graphic arts point sizes (that is, 8,
  83. 9, 10, 12, 14, 18, and 24). Screen fonts are measured in line sizes
  84. (lines-per-inch) rather than typographic point sizes. Specific line sizes
  85. of the fonts may be different from their nominal point sizes.
  86.  
  87.  
  88. Metrics Files
  89.  
  90. Downloadable and cartridge fonts need Printer Font Metrics (PFM) and
  91. Printer Cartridge Metrics (PCM) files. These files contain the same kind of
  92. header information as Windows screen-font files, but also include extended
  93. font metrics, kerning tables, and driver-specific information. A Windows
  94. printer driver uses the information in a metrics file to prepare the width
  95. and kerning tables used by the application during composition. A font
  96. vendor must provide PFM files for downloadable fonts and PCM files for
  97. cartridges.
  98.  
  99.  
  100. Permanent and Temporary Downloadable Fonts
  101.  
  102. There are two forms of downloadable fonts:
  103.  
  104. o   Permanent Soft Fonts. These are copied from the computer to the printer
  105.     when the printer is first turned on, and remain there until the printer
  106.     is turned off. The Windows printer driver has access to permanent soft
  107.     fonts for all the documents that it prints.
  108.  
  109. o   Temporary Soft Fonts. These are copied from the computer to the printer
  110.     on an as-needed basis during the print job. They are deleted from the
  111.     printer's memory at the end of a print job.
  112.  
  113. Settings in the WIN.INI file specify whether a downloadable font is
  114. permanent or temporary. Furthermore, permanent fonts typically have a
  115. corresponding batch file that copies the fonts to the printer when the
  116. system first starts.
  117.  
  118.  
  119. Downloadable and Cartridge-Font Installation
  120.  
  121. For the Windows printer driver to correctly locate downloadable or
  122. cartridge fonts, the driver or a vendor-supplied utility must perform the
  123. following operations:
  124.  
  125. o   Install the PFM, screen font, and downloadable font files by copying
  126.     them from the font manufacturer's floppy disks to the user's hard drive.
  127.  
  128. o   Add the softfont or cartridge settings in the WIN.INI file.
  129.  
  130. Ideally, the softfont and cartridge settings in the WIN.INI file should be
  131. set automatically by an installation program. Some Windows drivers, such as
  132. the HP LaserJet printer driver that uses PCL, contain their own font
  133. installation program. If the driver does not contain an installation
  134. program, the font vendor should make every effort to provide an
  135. installation program rather than direct the user to install the files
  136. manually.
  137.  
  138. Chapter 1  Screen Fonts for Windows
  139.  
  140. Screen fonts provide a reasonable approximation of printer output on the
  141. screen. Microsoft Windows applications that compose text for printers need
  142. accurate screen fonts to ensure a WYSIWYG display. This means the screen
  143. fonts must match the printer fonts as closely as possible. The more
  144. accurate the representation, the more accurate the display. This chapter
  145. presents the factors font vendors should consider when creating screen
  146. fonts.
  147.  
  148.  
  149. 1.1 Aspect-Ratio Classes for Display Devices
  150.  
  151. Font vendors should create one set of screen fonts for each of the popular
  152. aspect-ratio classes for displays. The aspect-ratio classes determine the
  153. relative shape of pixels on the device, and therefore affect the design and
  154. implementation of screen fonts. Windows recognizes two major aspect-ratio
  155. classes.
  156.  
  157. Class          Typical device
  158. ---------------------------------------------------------------------------
  159.  
  160. 1.33:1 (4:3)   The IBM Enhanced Graphics Adapter
  161.  
  162. 1:1            The IBM PS/2 MCGA, VGA, and 8514/a
  163.  
  164. The actual dots-per-inch resolution is not a factor in determining the
  165. class of the device; only the aspect ratio is used.
  166.  
  167.  
  168. 1.2 Translating Point Sizes into Line Sizes
  169.  
  170. Because of the variation in screen resolutions, screen font sizes are
  171. discussed in terms of screen line sizes, not typographic point sizes. The
  172. equation for relating point size to equivalent screen line size is as
  173. follows:
  174.  
  175.                         text point size  * lines-per-inch
  176.     screen line size =  --------------------------------------
  177.                                         72
  178. The lines-per-inch value specifies the logical page size for the device.
  179. When possible, the lines-per-inch closely matches the physical size and
  180. aspect ratio. The common screen lines-per-inch sizes for devices supported
  181. by Windows are as follows:
  182.  
  183. o   For a 1:1 aspect ratio, 96:96 (VGA), 108:108, 120:120 (8514/a), and
  184.     144:144
  185.  
  186. o   For a 4:3 aspect ratio, 96:72 (IBM Enhanced Graphics Adapter)
  187.  
  188. Since it is always better to select a smaller size when an exact match is
  189. not possible, the quotient in the equation is truncated if the result is a
  190. fractional line size.
  191.  
  192.  
  193. 1.3 Choosing the Correct Range of Line Sizes
  194.  
  195. To accurately represent a printer font on the screen, the font vendor must
  196. make available a reasonable range of screen fonts. However, each screen
  197. font uses memory. Therefore, a font vendor should carefully weigh
  198. performance against a large screen-font variety.
  199.  
  200. The most important factor to consider when creating screen-font files is
  201. memory use. Fewer and smaller screen fonts use less memory, but may degrade
  202. the WYSIWYG quality of the display.
  203.  
  204. Other factors to consider include the following:
  205.  
  206. o   Legibility Threshold. There is a certain size at which the fonts are
  207.     difficult, if not impossible, to read. For most screens, the value is 6
  208.     lines. For high-resolution screens, the value is around 9-10 lines.
  209.     Therefore, it does not make sense to provide fonts below these sizes.
  210.  
  211. o   Doubling and Tripling. The screen driver may double or triple a
  212.     small-size font to take the place of an unavailable large font. For
  213.     example, it may double an 18-line font to make a 36-line font, or it
  214.     may triple a 24-line font to make a 72-line font. Doubling is not
  215.     attractive, but acceptable and difficult to avoid. Tripling is
  216.     unacceptable and can be avoided by providing a well-chosen range of
  217.     screen line sizes.
  218.  
  219. o   Specific Applications. The application can control how the screen
  220.     driver will select a font for such things as text greeking, doubling
  221.     and tripling, vector font substitution, and downsizing to match widths.
  222.  
  223.  
  224. 1.4 Greeking
  225.  
  226. Some applications stop displaying screen fonts below a certain line size
  227. and may display a gray shaded box or other graphic representation. This is
  228. referred to as greeked text. Greeking speeds up the screen display.
  229.  
  230.  
  231. 1.5 Proof Versus Draft Quality
  232.  
  233. In Windows, proof usually means good, and draft means poor but quick. The
  234. screen driver will never double or triple the size of a font for proof
  235. quality. However, it will double or triple the size of smaller fonts to get
  236. the exact size it wants for draft quality. If the correct size is
  237. available, the screen driver will always choose it.
  238.  
  239. Doubling and tripling occur only when the exact size is not available. For
  240. example, assume the only screen sizes are 10 and 19 lines, and the
  241. application wants a 20-line screen font. In proof quality, the screen
  242. driver would choose the 19-line font. In draft quality, the screen driver
  243. would double the 10-line font.
  244.  
  245.  
  246. 1.6 Vector Font Substitution
  247.  
  248. Vector outline fonts are not as attractive as raster screen fonts, but they
  249. look better than doubled or tripled screen fonts. Also, the amount of
  250. memory used by vector fonts is constant while the amount of memory used by
  251. raster fonts increases as the font size increases.
  252.  
  253.  
  254. 1.7 Downsizing to Match Widths
  255.  
  256. When the screen fonts do not accurately represent the printer fonts (that
  257. is, the height-to-width ratio of the printer font is different from that of
  258. the screen font), an application can request a smaller font to get the
  259. correct width. The application can display the line more quickly and
  260. prevent the characters from overlapping using this method.
  261.  
  262. This behavior can most often be observed when the font vendor does not
  263. supply matching screen fonts, or the screen fonts do not contain the same
  264. height-to-width ratio as their corresponding printer fonts.
  265.  
  266.  
  267. 1.8 Recommended Screen-Font Sizes
  268.  
  269. Nothing produces an accurate display representation than a wide range of
  270. screen font sizes. On the other hand, nothing affects system performance
  271. faster than a large number of screen fonts. Therefore, the selection of
  272. screen fonts must balance desired display quality with system performance.
  273.  
  274. For example, consider two computers with different screen-font
  275. configurations. Computer A contains the screen font sizes 7, 10, and 16
  276. lines. Computer B contains the sizes 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  277. 17, and 18 lines. If the user creates a page using all the fonts from
  278. Computer B, the differences in sizes will be visible. However, the computer
  279. will load 12 screen fonts to display the page.
  280.  
  281. On Computer A, with doubling and tripling capabilities disabled, the
  282. computer displays the same range of sizes as follows:
  283.  
  284. o   7, 8, and 9 lines displayed with the 7-line font
  285.  
  286. o   10, 11, 12, 13, 14, and 15 lines displayed with the 10-line font
  287.  
  288. o   16, 17, and 18 lines displayed with the 16-line font
  289.  
  290. Much of the WYSIWYG would be lost because several sizes are displayed with
  291. the same font. However, the computer only loaded three fonts to display the
  292. page.
  293.  
  294. Computer B slowly displayed high quality, while Computer A quickly
  295. displayed poor WYSIWYG quality.
  296.  
  297. A font vendor needs to consider the application the user will run with
  298. Windows. For example, Microsoft Excel generally uses body-size fonts (fonts
  299. in the size range of 8 to 12 points). Therefore, a wide range of font sizes
  300. is unnecessary. And Aldus PageMaker, although it uses a large range of
  301. sizes, switches to vector fonts above 24 lines (that is, the default Vector
  302. text above setting).
  303.  
  304. Ideally, the user should decide which is more important: display quality or
  305. performance. Many font products contain a font generator that requires the
  306. user to specify which point sizes to build. For such programs, the user
  307. should be given the option to select a predetermined range of sizes.
  308.  
  309. Range         Sizes
  310. ---------------------------------------------------------------------------
  311.  
  312. Publishing    8, 9, 10, 12, 14, 18, and 24 lines.
  313.  
  314. Artwork       7, 8, 9, 10, 11, 12, 14, 16, 18, 21, 24, 28, and 32 lines.
  315.  
  316. General use   8, 10, 12, 18, and 24 lines.
  317.  
  318. If the font-creation program requires the user to indicate exactly which
  319. sizes should be built (that is, there are no predetermined ranges), then
  320. the documentation should provide specific instructions on what numbers to
  321. enter, based upon the user's needs, or intended use for the product.
  322.  
  323. For font packages that give the user no choice in the size range, the
  324. vendor should supply the Publishing size range of 8, 9, 10, 12, 14, 18, and
  325. 24 lines.
  326.  
  327. Chapter 2  Metrics File Formats
  328.  
  329. Microsoft Windows printer drivers provide lists of the fonts available on
  330. the printer. Although most drivers have the text metrics for a few
  331. device-resident fonts built in as resources, the majority of the
  332. printer-font metrics are external to the drivers and are in the form of
  333. Microsoft Windows printer font metrics files. This chapter describes the
  334. format of the font metrics files for Windows printer drivers.
  335.  
  336.  
  337. 2.1 Printer Font Metrics Files
  338.  
  339. A printer font metrics (PFM) file has the following general form:
  340.  
  341.     PFMHEADER       Header;          /* font header */
  342.     WORD            WidthTable[];    /* character widths */
  343.     PFMEXTENSION    Extensions;      /* extensions */
  344.     char            DeviceName[];    /* printer-device name */
  345.     char            FaceName[];      /* font name */
  346.     EXTTEXTMETRIC   ExtTextMetrics;  /* extended-text metrics */
  347.     WORD            ExtentTable[];   /* unscaled-character widths */
  348.     DRIVERINFO      DriverInfo;      /* driver-specific information */
  349.     PAIRKERN        KerningPairs[];  /* pair-kerning table */
  350.     KERNTRACK       KerningTracks[]; /* track-kerning table */
  351. The PFMHEADER structure, the PFMEXTENSION structure, and font name must be
  352. present in every PFM file. Whether a PFM file contains any of the other
  353. structures and arrays depends on the printer driver and the font vendor's
  354. preferences.
  355.  
  356. The PFMHEADER and PFMEXTENSION structures must be, respectively, the first
  357. and second structures in the file. The remaining structures and arrays may
  358. appear in any order. Their locations are indicated by the offsets in the
  359. PFMHEADER and PFMEXTENSION structures.
  360.  
  361. The following sections describe the arrays in the file, such as the width
  362. table. For more information about the structures, see Section 2.4,
  363. Structure Reference, later in this chapter.
  364.  
  365.  
  366. 2.1.1 Width Table
  367.  
  368. The width table in the PFM file is an array of 16-bit values containing the
  369. width of each character in the font. The number of elements in the array is
  370. computed as dfLastChar - dfFirst + 2. Since the last entry is extra, it is
  371. set to zero.
  372.  
  373. The width table is optional. For example, fixed-pitch fonts do not require
  374. the table since all characters have the same width. If the table is
  375. provided, it must be placed between the PFMHEADER and PFMEXTENSION
  376. structures.
  377.  
  378.  
  379. 2.1.2 Device and Font Names
  380.  
  381. The device and font names are null-terminated strings specifying the name
  382. of the printer device and font face, respectively.
  383.  
  384.  
  385. 2.1.3 Extent Table
  386.  
  387. The extent table is an array of 16-bit values containing the width of each
  388. character in the font at the default point size.
  389.  
  390.  
  391. 2.2 Printer-Cartridge Metrics Files
  392.  
  393. A printer-cartridge metrics (PCM) file has the following general form:
  394.  
  395.     PCMHEADER   Header;             /* font header           */
  396.     char        CartridgeTitle[];   /* title for cartridge   */
  397.     BYTE        PFMFiles[];         /* an array of PFM files */
  398. The PCMHEADER structure contains information about the PCM files, such as
  399. its size and the location of the cartridge title. For more information
  400. about structures, see Section 2.4, Structure Reference later in this
  401. chapter.
  402.  
  403. The PCMHEADER structure must contain a nonzero offset to the cartridge
  404. title. This string must be nonempty and null-terminated. This title is used
  405. in the cartridge list box in the Printer Setup dialog box.
  406.  
  407. The PCM file must contain one PFM file for each font in the cartridge. The
  408. files must be appended together. Since each PFM file contains its own size
  409. in bytes, the location of each PFM file is calculated as an offset from the
  410. previous PFM file. All file positions in a PFM file itself are offsets from
  411. the beginning of the individual PFM file and the PCM file.
  412.  
  413.  
  414. 2.3 Font Scaling: etmMasterHeight and etmMasterUnits
  415.  
  416. Printer drivers use the values in the etmMasterHeight and etmMasterUnits
  417. members of the EXTTEXTMETRIC structure to scale the character width values
  418. in the extent table. A driver allows two methods for measuring character
  419. widths:
  420.  
  421. o   Device units or pixels
  422.  
  423. o   Font units
  424.  
  425. Device units are the number of dots in the physical device (dots-per-inch);
  426. etmMasterHeight is expressed in device units. It may be converted to points
  427. using the formula:
  428.  
  429.                        etmMasterHeight device units * 72 points-per-inch
  430.     height in points = ---------------------------------------------------
  431.                                dfVertRes device units-per-inch
  432. In this case, 72 represents the number of points-per-inch. The dfVertRes
  433. member contains the number of dots-per-inch in device units.
  434.  
  435. Font units may differ from device units as a convenience to the font
  436. vendor. If the font is intended for devices that differ in resolution,
  437. there typically is no benefit from mapping the resolution of the font to
  438. the resolution of a particular printer. The vendor uses the units that are
  439. most convenient for designing the font. For example, 1000 units-per-cell
  440. (or em) is the Adobe standard for PostScript fonts; etmMasterUnits is
  441. expressed in font units-per-em where an em equals etmMasterHeight.
  442.  
  443. A number may be converted from device units to font units using the
  444. formula:
  445.  
  446.  
  447.     value in font units =
  448.              value in device units * etmMasterUnits font units
  449.              -------------------------------------------------
  450.                        etmMasterHeight device units
  451.  
  452. The formula for the inverse operation is:
  453.  
  454.  
  455.     value in device units =
  456.              value in font units * etmMasterHeight device units
  457.              --------------------------------------------------
  458.                       etmMasterUnits font units
  459.  
  460. 2.3.1 Determining Character Widths
  461.  
  462. The values in the extent table are the widths of the characters when the
  463. font height equals etmMasterHeight. When the font height does not equal
  464. etmMasterHeight, the driver must scale the values from the extent table.
  465. Always assume linear scaling fonts.
  466.  
  467. The values in the extent table are in font units. The width of a character
  468. for a particular font height may be computed as follows:
  469.  
  470.  
  471.     character width      value from extent table in font units
  472.     ---------------   =  -------------------------------------
  473.       fontheight            etmMasterUnits font units
  474. By multiplying font height through the equation, we have the formula for
  475. computing character width:
  476.  
  477.                       font height * value from extent table in font units
  478.     character width = ---------------------------------------------------
  479.                                    etmMasterUnits font units
  480. Character width takes on the units of font height. If the font height is in
  481. device units, the resulting width will be in device units. If the font
  482. height is in font units, the resulting width will be in font units.
  483.  
  484. In its normal mode of operation, the driver simply plugs the font height
  485. into the above equation to compute the character width. Font height is
  486. normally in device units, so the resulting width is normally in device
  487. units.
  488.  
  489. For example, assume the device resolution is 300 dpi and the font units are
  490. expressed as 1000 units-per-em. Assuming that the etmMasterHeight member
  491. represents a 72-point font, the values would look like this:
  492.  
  493. dfVertRes = 300
  494.  
  495. etmMasterHeight = 300
  496.  
  497. etmMasterUnits = 1000
  498.  
  499. Additionally, assume the value in the width table for a capital H is 500
  500. font units, or half the em height. Assume the height of the font for which
  501. you want the character width is 12 points, or 50 device units. With
  502. relative widths disabled, the character width would be computed using the
  503. first width formula:
  504.  
  505.     50 device units * 500 font units
  506.     --------------------------------  = 25 device units
  507.          1000 font units
  508.  
  509. 2.3.2 Using the ENABLERELATIVEWIDTHS Escape
  510.  
  511. When the application calls the ENABLERELATIVEWIDTHS escape, the driver
  512. expects the application to request a font height in device units, but will
  513. return the character width in font units. The application may want to
  514. obtain widths in font units to alleviate any error that may result from
  515. rounding widths to device units. It is the responsibility of the driver to
  516. correct this error when relative widths are disabled, but the application
  517. may choose to enable relative widths and perform its own error correction.
  518.  
  519. The driver converts the font height (in device units) to font units prior
  520. to computing the character width. The resulting formula is:
  521.  
  522.     character width in font units =
  523.          font height in device units * character extent in font units
  524.          ------------------------------------------------------------
  525.                          etmMasterHeight device units
  526. This formula was computed by replacing the font height from the first
  527. formula for character width with the formula for converting a value from
  528. device units to font units, and then simplifying the equation.
  529.  
  530. Using the same assumptions provided in the previous section, you can now
  531. work through some more examples. You know that the width of the character
  532. is 25 device units (that is, dots or pixels) or half the height of 50
  533. device units. With relative widths enabled, the character width would be
  534. computed using the second width formula:
  535.  
  536.     50 device units * 500 font units
  537.     -------------------------------- = 83.333 font units
  538.         300 device units
  539. The width of the character is 83.333 font units. The driver will round
  540. noninteger results.
  541.  
  542. To demonstrate that the width in font units is equivalent to the width in
  543. device units, it can be converted to device units using the formula
  544. provided in the previous section:
  545.  
  546.     83.333 font units  * 300 device units
  547.     ------------------------------------- = 25 device units
  548.        1000 font units
  549. For more information about the restrictions imposed by drivers, see Chapter
  550. 3, The PFM Editor, and Chapter 4, PCL/HP LaserJet Printer Driver.
  551.  
  552.  
  553. 2.4 Structure Reference
  554.  
  555. The following is an alphabetical listing of the structures used in PFM and
  556. PCM files.
  557.  
  558. DRIVERINFO
  559.  
  560.     typedef struct tagDRIVERINFO {
  561.         WORD epSize;      /* size of this data structure */
  562.         WORD epVersion;   /* number indicating structure version */
  563.         DWORD epMemUsage; /* amount of memory font takes up in printer */
  564.         DWORD epEscape;   /* pointer to escape that selects the font */
  565.         TRANSTABLE xtbl;  /* character-set translation information */
  566.     } DRIVERINFO;
  567. The DRIVERINFO structure contains information that is specific to the given
  568. device. The structure described here is intended to be used in PFM file for
  569. the HP LaserJet printer driver that uses Printer Control Language (PCL).
  570.  
  571.  
  572. Members
  573.  
  574.    epSize
  575.    Specifies the size of this structure (number of bytes).
  576.  
  577.    epVersion
  578.    Specifies the version of this structure, currently 1.
  579.  
  580.    epMemUsage
  581.    Specifies the amount of printer memory (in bytes) that this font uses.
  582.  
  583.    epEscape
  584.    Specifies the byte offset from the beginning of the file to an escape
  585.    string calling the font.
  586.  
  587.    xtbl
  588.    Specifies a TRANSTABLE structure containing character-translation data.
  589.  
  590.  
  591.  
  592. EXTTEXTMETRIC
  593.  
  594.     typedef struct{
  595.         short etmSize;
  596.         short etmPointSize;
  597.         short etmOrientation;
  598.         short etmMasterHeight;
  599.         short etmMinScale;
  600.         short etmMaxScale;
  601.         short etmMasterUnits;
  602.         short etmCapHeight;
  603.         short etmXHeight;
  604.         short etmLowerCaseAscent;
  605.         short etmUpperCaseDescent;
  606.         short etmSlant;
  607.         short etmSuperScript;
  608.         short etmSubScript;
  609.         short etmSuperScriptSize;
  610.         short etmSubScriptSize;
  611.         short etmUnderlineOffset;
  612.         short etmUnderlineWidth;
  613.         short etmDoubleUpperUnderlineOffset;
  614.         short etmDoubleLowerUnderlineOffset;
  615.         short etmDoubleUpperUnderlineWidth;
  616.         short etmDoubleLowerUnderlineWidth;
  617.         short etmStrikeOutOffset;
  618.         short etmStrikeOutWidth;
  619.         WORD  etmKernPairs;
  620.         WORD  etmKernTracks;
  621.     }EXTTEXTMETRIC;
  622. The EXTTEXTMETRIC structure provides extended-metric information for a
  623. font. All the measurements are given in the specified units, regardless of
  624. the current mapping mode of the display context.
  625.  
  626.  
  627. Members
  628.  
  629.    etmSize
  630.    Specifies the size of this structure (in bytes).
  631.  
  632.    etmPointSize
  633.    Specifies the nominal point size of this font in twips (twentieths of a
  634.    point). This is the intended graphics art size of the font; the actual
  635.    size may differ slightly depending on the resolution of the device.
  636.  
  637.    etmOrientation
  638.    Specifies the font's orientation. It can be one of the following values.
  639.  
  640.     Value   Meaning
  641.     -----------------------------------------------------------------------
  642.  
  643.     0       Either orientation.
  644.  
  645.     1       Portrait.
  646.  
  647.     2       Landscape.
  648.  
  649.    This value refers to the ability of this font to be imaged on a page of
  650.    the given orientation. Landscape pages are those whose width
  651.    (x-dimension) is greater than their height (y-dimension).
  652.  
  653.    etmMasterHeight
  654.    Specifies the font size in device units for which the values in this
  655.    font's extent table are exact.
  656.  
  657.    etmMinScale
  658.    Specifies the minimum valid size for a given font (in device units).
  659.  
  660.                                   etmMinScale * 72
  661.             smallest point size = ----------------
  662.                                       dfVertRes
  663.    In this example, 72 represents the number of points-per-inch. The
  664.    dfVertRes member contains the number of dots-per-inch.
  665.  
  666.    etmMaxScale 
  667.    Specifies the maximum valid size for a given font (in device units).
  668.  
  669.                                  etmMaxScale * 72
  670.             largest point size = ----------------
  671.                                     dfVertRes
  672.    In this example, 72 represents the number of points-per-inch. The
  673.    dfVertRes member contains the number of dots-per-inch.
  674.  
  675.    etmMasterUnits
  676.    Specifies the integer number of units-per-em where an em equals
  677.    etmMasterHeight. In other words, the etmMasterHeight member is expressed
  678.    in font units rather than device units.
  679.  
  680.    etmCapHeight
  681.    Specifies the height of uppercase characters for a given font (in font
  682.    units). Typically, H is used for the measurement purposes.
  683.  
  684.    etmXHeight
  685.    Specifies the height of lowercase characters for a given font (in font
  686.    units). Typically, x is used for the measurement purposes.
  687.  
  688.    etmLowerCaseAscent
  689.    Specifies the distance (in font units) that the ascender of lowercase
  690.    letters extends above the baseline. This distance is typically specified
  691.    for a lowercase d.
  692.  
  693.    etmLowerCaseDescent
  694.    Specifies the distance (in font units) that the descender of lowercase
  695.    letters extends below the baseline. This distance is typically specified
  696.    for a lowercase p.
  697.  
  698.    etmSlant
  699.    Specifies the angle in tenths of degrees clockwise (to the right) from
  700.    the upright version of the font (assuming this font is slanted or
  701.    italicized).
  702.  
  703.    etmSuperScript
  704.    Specifies the recommended amount (in font units) to offset superscript
  705.    characters from the baseline. This amount is typically specified by a
  706.    negative offset.
  707.  
  708.    etmSubScript
  709.    Specifies the recommended amount (in font units) to offset subscript
  710.    characters from the baseline. This amount is typically specified by a
  711.    positive offset.
  712.  
  713.    etmSuperScriptSize
  714.    Specifies the recommended size (in font units) of superscript characters
  715.    for this font.
  716.  
  717.    etmSubScriptSize
  718.    Specifies the recommended size (in font units) of subscript characters
  719.    for this font.
  720.  
  721.    etmUnderlineOffset
  722.    Specifies the offset (in font units) downward from the baseline where
  723.    the top of a single underline bar should appear.
  724.  
  725.    etmUnderlineWidth
  726.    Specifies the thickness (in font units) of the underline bar.
  727.  
  728.    etmDoubleUpperUnderlineOffset
  729.    Specifies the offset (in font units) downward from the baseline where
  730.    the top of the upper, double underline bar should appear.
  731.  
  732.    etmDoubleLowerUnderlineOffset
  733.    Specifies the offset (in font units) downward from the baseline where
  734.    the top of the lower, double underline bar should appear.
  735.  
  736.    etmDoubleUpperUnderlineWidth
  737.    Specifies the thickness (in font units) of the upper, double underline
  738.    bar.
  739.  
  740.    etmDoubleLowerUnderlineWidth
  741.    Specifies the thickness (in font units) of the lower, double underline
  742.    bar.
  743.  
  744.    etmStrikeOutOffset
  745.    Specifies the offset (in font units) upward from the baseline where the
  746.    top of a strikeout bar should appear.
  747.  
  748.    etmStrikeOutWidth
  749.    Specifies the thickness (in font units) of the strikeout bar.
  750.  
  751.    etmKernPairs
  752.    Specifies the number of character-kerning pairs defined for the given
  753.    font. You can use this value to calculate the size of the pair-kern
  754.    table returned by the GETPAIRKERNTABLE escape. It will not be greater
  755.    than 512 kern pairs.
  756.  
  757.    etmKernTracks
  758.    Specifies the number of kerning tracks defined for the given font. You
  759.    can use this value to calculate the size of the track-kern table
  760.    returned by the GETTRACKKERNTABLE escape. It will not be greater than 16
  761.    kern tracks.
  762.  
  763.  
  764.  
  765. PCMHEADER
  766.  
  767.     typedef struct _PCMHEADER {
  768.         WORD pcmMagic;
  769.         WORD pcmVersion;
  770.         DWORD pcmSize;
  771.         DWORD pcmTitle;
  772.         DWORD pcmPFMList;
  773.     } PCMHEADER;
  774. The PCMHEADER structure contains information about the PCM file.
  775.  
  776.  
  777. Members
  778.  
  779.    pcmMagic
  780.    Contains the magic number 3244 (0x0CAC). The Printer Font Installer uses
  781.    it to recognize PCM files when no FINSTALL.DIR file is supplied with the
  782.    PCM file.
  783.  
  784.    pcmVersion
  785.    Contains the version number of the PCM file. The upper byte contains the
  786.    version number and the lower byte the revision number, both in BCD.
  787.  
  788.    pcmSize
  789.    Contains the size (in bytes) of the entire PCM file.
  790.  
  791.    pcmTitle
  792.    Specifies the offset from the beginning of the file to the title string
  793.    for the cartridge.
  794.  
  795.    pcmPFMList
  796.    Specifies the offset from the beginning of the file to the first PFM.
  797.  
  798.  
  799.  
  800. PFMEXTENSION
  801.  
  802.     typedef tagPFMEXTENSION {
  803.         WORD  dfSizeFields;
  804.         DWORD dfExtMetricsOffset;
  805.         DWORD dfExtentTable;
  806.         DWORD dfOriginTable;
  807.         DWORD dfPairKernTable;
  808.         DWORD dfTrackKernTable;
  809.         DWORD dfDriverInfo;
  810.         DWORD dfReserved;
  811.     } PFMEXTENSION;
  812. The PFMEXTENSION structure contains extended information for printer fonts.
  813.  
  814.  
  815. Members
  816.  
  817.    dfSizeFields
  818.    Specifies the size (in bytes) of this structure.
  819.  
  820.    dfExtMetricsOffset
  821.    Specifies the byte offset in the file to the EXTTEXTMETRIC structure for
  822.    the given font.
  823.  
  824.    dfExtentTable
  825.    Specifies the byte offset in the file to the extent table. The size of
  826.    the table is dfLastChar - dfFirstChar + 1 WORD. The extent table
  827.    contains the unscaled widths (in 1/1000's of an em) of the characters in
  828.    the font.
  829.  
  830.    dfOriginTable
  831.    Specifies the byte offset in the file to the table of character origins.
  832.    The size of the table is dfLastChar - dfFirstChar + 1 WORD. For
  833.    screen-font files, this table gives the signed amount of left adjustment
  834.    to add to the current position before drawing the characters. Negative
  835.    values indicate left movement; positive values indicate right movement.
  836.    This should be NULL for PFM files.
  837.  
  838.    dfPairKernTable
  839.    Specifies the byte offset in the file to the optional pair-kerning table
  840.    should be NULL if no kerning pairs are defined for this font. The size
  841.    of the table is given by the etmKernPairs member of the EXTTEXTMETRIC
  842.    structure.
  843.  
  844.    dfTrackKernTable
  845.    Specifies the byte offset in the file to the optional track-kerning
  846.    table. This should be NULL if no kerning tracks are defined for this
  847.    font. The size of the table is given by the etmKernTracks member of the
  848.    EXTTEXTMETRIC structure.
  849.  
  850.    dfDriverInfo
  851.    Specifies the byte offset in the file to additional driver-specific
  852.    information. Each driver writer is responsible for documenting the
  853.    format of the data pointed to by this member. These formats will be made
  854.    public so that third parties that want to create compatible printer font
  855.    metrics files may do so.
  856.  
  857.    dfReserved
  858.    Reserved; must be zero.
  859.  
  860.  
  861.  
  862. PFMHEADER
  863.  
  864.     typedef struct PFMHEADER {
  865.         WORD  dfVersion;
  866.         WORD  dfSize;
  867.         char  dfCopyright[60];
  868.         WORD  dfType;
  869.         WORD  dfPoints;
  870.         WORD  dfVertRes;
  871.         WORD  dfHorizRes;
  872.         WORD  dfAscent;
  873.         WORD  dfInternalLeading;
  874.         WORD  dfExternalLeading;
  875.         BYTE  dfItalic;
  876.         BYTE  dfUnderline;
  877.         BYTE  dfStrikeOut;
  878.         WORD  dfWeight;
  879.         BYTE  dfCharSet;
  880.         WORD  dfPixWidth;
  881.         WORD  dfPixHeight;
  882.         BYTE  dfPitchAndFamily;
  883.         WORD  dfAvgWidth;
  884.         WORD  dfMaxWidth;
  885.         BYTE  dfFirstChar;
  886.         BYTE  dfLastChar;
  887.         BYTE  dfDefaultChar;
  888.         BYTE  dfBreakChar;
  889.         WORD  dfWidthBytes;
  890.         DWORD dfDevice;
  891.         DWORD dfFace;
  892.         DWORD dfBitsPointer;
  893.         DWORD dfBitsOffset;
  894.     } PFMHEADER;
  895. The PFMHEADER structure contains the information about a Windows raster or
  896. vector font. The PFMHEADER structure is identical to the Windows 2.x
  897. FONTINFO structure. The PFMHEADER structure is also identical to a
  898. font-file header. For more information about the FONTINFO structure, see
  899. the Microsoft Windows Device Driver Adaptation Guide.
  900.  
  901.  
  902.  
  903. SYMBOLSET
  904.  
  905.     typedef enum{
  906.         epsymUserDefined,
  907.         epsymRoman8,
  908.         epsymKana8,
  909.         epsymMath8,
  910.         epsymUSASCII,
  911.         epsymLineDraw,
  912.         epsymMathSymbols,
  913.         epsymUSLegal,
  914.         epsymRomanExt,
  915.         epsymISO_DenNor,
  916.         epsymISO_UK,
  917.         epsymISO_France,
  918.         epsymISO_German,
  919.         epsymISO_Italy,
  920.         epsymISO_SwedFin,
  921.         epsymISO_Spain,
  922.         epsymGENERIC7,
  923.         epsymGENERIC8,
  924.         epsymECMA94
  925.     } SYMBOLSET;
  926. The SYMBOLSET structure enumerates all supported symbol-set values.
  927.  
  928.  
  929.  
  930. TRANSTABLE
  931.  
  932.     typedef struct tagTRANSTABLE {
  933.         SYMBOLSET symbolSet;        /* kind of translation table */
  934.         DWORD offset;               /* location of user-defined table */
  935.         WORD len;                   /* length (in bytes) of table */
  936.         BYTE firstchar,lastchar;    /* table range */
  937.     } TRANSTABLE;
  938. The TRANSTABLE structure contains information needed to translate font
  939. characters from the character set specified by the dfCharSet member into
  940. the printer-specific character set.
  941.  
  942.  
  943. Members
  944.  
  945.    symbolSet
  946.    Specifies the symbol-set identifier, such as epsymRoman8 or epsymECMA94.
  947.  
  948.    offset
  949.    Specifies the byte offset from beginning of the file to a
  950.    custom-translation table.
  951.  
  952.    len
  953.    Specifies the size of the custom-translation table.
  954.  
  955.    firstchar
  956.    Specifies the first character translated in the table.
  957.  
  958.    lastchar
  959.    Specifies the last character translated.
  960.  
  961.  
  962. Comments
  963.  
  964. When the symbolSet member of the xtbl member equals epsymUserDefined, the
  965. driver uses the custom-translation table pointed to by the offset member of
  966. the xtbl member. However, the Windows PCL driver currently ignores all
  967. members in the TRANSTABLE structure except the symbolSet member of the xtbl
  968. member. In other words, even if a custom-translation table is put in for
  969. future support, the current driver ignores it.
  970.  
  971. Chapter 3  The PFM Editor
  972.  
  973. The Printer Font Metrics (PFM) Editor is a Microsoft Windows application
  974. that a font vendor can use to create and edit PFM files and create Printer
  975. Cartridge Metrics (PCM) files for Hewlett-Packard printers and printer
  976. drivers that use Printer Control Language (PCL). The PFM Editor simplifies
  977. and accelerates the task of creating PFM files by not requiring a great
  978. deal of knowledge about either the PFM file format or Windows device
  979. drivers. The PFM Editor allows developers with some font experience to
  980. create the information file needed by the driver to support the cartridge.
  981.  
  982. The PFM Editor reads the filename of a PFM file from the command line in
  983. the WIN.INI file. Thus, defining the PFM extension in WIN.INI allows the
  984. user to double-click PFM files to edit them.
  985.  
  986.  
  987. 3.1 The Main Window
  988.  
  989. The main window of the PFM Editor contains several fields that give general
  990. identifying information about the font. All of these members appear in the
  991. PFMHEADER structure.
  992.  
  993. You should always specify at least the Pitch member before selecting any of
  994. the metrics or dialog boxes described in the following sections.
  995.  
  996. The following members appear in the main window.
  997.  
  998. Member        Description
  999. ---------------------------------------------------------------------------
  1000.  
  1001. Font Name     The name of the font, such as Courier(R).
  1002.  
  1003. Char Set      The character set the font represents. It can be one of the
  1004.               following values.
  1005.  
  1006.            Value   Meaning
  1007.            ----------------------------------------------------------------
  1008.  
  1009.            0       Windows ANSI
  1010.  
  1011.            180     Math-8 (PCL driver only)
  1012.  
  1013.            181     PI Font (PCL driver only)
  1014.  
  1015.            182     LineDraw (PCL driver only)
  1016.  
  1017.            183     PC Line (PCL driver only)
  1018.  
  1019.            184     Tax Line (PCL driver only)
  1020.  
  1021.            185     US Legal (PCL driver only)
  1022.  
  1023.            255     OEM character set
  1024.  
  1025. Pitch         Two selections: Fixed and Proportional.
  1026.  
  1027. Effects       Three selections indicating the appearance of the font:
  1028.               Italic, Underline, Strikeout.
  1029.  
  1030. Font Family   Six selections: Don't Care, Roman, Swiss, Modern, Script, and
  1031.               Decorative. The driver uses the family to classify fonts for
  1032.               identification and selection purposes.
  1033.  
  1034. Points        The point size of a font, or its height in units of 1/72 of
  1035.               an inch.
  1036.  
  1037. Weight        The weight of the font minus a number from 0 to 1000. 400
  1038.               represents a normal, medium font. Larger numbers represent
  1039.               bold fonts.
  1040.  
  1041. Copyright     A 60-character string containing the font supplier's
  1042.               copyright notice.
  1043.  
  1044.  
  1045. 3.2 The File Menu
  1046.  
  1047. The File menu contains all the standard Windows File menu commands along
  1048. with one extra command: Create PCM File. The following is a list with
  1049. descriptions of those commands.
  1050.  
  1051. Command           Description
  1052. ---------------------------------------------------------------------------
  1053.  
  1054. New               Causes the PFM Editor to reinitialize itself, and display
  1055.                   an empty, untitled PFM file.
  1056.  
  1057. Open              Displays a standard Open File Name dialog box. PFM is the
  1058.                   default file extension.
  1059.  
  1060. Save              Saves the PFM file with the same name as previously used
  1061.                   in a Load or Save operation. If the file is untitled, the
  1062.                   Save As dialog box appears.
  1063.  
  1064. Save As           Allows the user to specify a filename before saving.
  1065.  
  1066. Create PCM File   Allows the user to create a cartridge-metrics file for
  1067.                   the PCL driver.
  1068.  
  1069. Exit              Exits the PFM Editor.
  1070.  
  1071. About             Displays an informational dialog box.
  1072.  
  1073. As with all applications, the user is given the opportunity to save or
  1074. cancel if the New, Open, or Exit commands are chosen when the current file
  1075. has been saved, but not changed.
  1076.  
  1077.  
  1078. 3.3 The Metrics Menu
  1079.  
  1080. The Metrics menu allows you to activate dialog boxes to specify dimensional
  1081. information about the font. The Metrics popup menu contains three options:
  1082. Basics, Extended, and Effects.
  1083.  
  1084. Basic metrics includes information about character-range heights and such
  1085. things as average widths, device resolution, and leading.
  1086.  
  1087. Extended metrics is detailed information about the geometry of the font,
  1088. including such things as baseline, ascents and descents, orientation,
  1089. scale, and so on.
  1090.  
  1091. Effects metrics is information about how to synthesize effects such as
  1092. underlining and strikeout. To get to this dialog box, you must first go
  1093. through the Extended Metrics dialog box.
  1094.  
  1095.  
  1096. 3.3.1 The Basic Metrics Dialog Box
  1097.  
  1098. From the Metrics menu, choose the Basics command to display the Basic
  1099. Metrics dialog box. It contains information about font size. The dialog box
  1100. contains the following text boxes.
  1101.  
  1102. Text box                  Description
  1103. ---------------------------------------------------------------------------
  1104.  
  1105. Characters                The first character in the character set. This is
  1106. First                     the numeric character code of the first character
  1107.                           for which the font contains a printable character.
  1108.  
  1109. Last                      The last character in the character set. This is
  1110.                           usually 127 for a 7-bit character set, or 255 for
  1111.                           an 8-bit character set.
  1112.  
  1113. Default                   The code of the character printed if the driver
  1114.                           is asked to print a character that falls outside
  1115.                           the range First through Last.
  1116.  
  1117. Break                     The character that delimits words in word
  1118.                           wrapping. If an application or the DrawText
  1119.                           function is asked to wrap a string in a box, it
  1120.                           will break the string into multiple lines only at
  1121.                           break character positions. This is generally the
  1122.                           space character (32 in both ANSI and ASCII).
  1123.  
  1124. Leading                   The leading that appears within the height
  1125. Internal                  specified by the height of the font. Diacritical
  1126.                           marks appear in this space.
  1127.  
  1128. External                  The recommended additional space to insert
  1129.                           between lines. This space is not already
  1130.                           accounted for in the height of the font.
  1131.  
  1132. Resolution                The number of dots-per-inch at which the font was
  1133. Horizontal and Vertical   digitized. For an HP LaserJet, for example, both
  1134.                           of these numbers should be 300.
  1135.  
  1136. Widths                    For proportional space fonts, the average width
  1137. Average                   of all the characters in the font. This box is
  1138.                           relabeled All for fixed-pitch fonts, because all
  1139.                           fixed-pitch characters have the same width. It is
  1140.                           represented in font units. The PFM Editor does
  1141.                           not calculate the average width from the width
  1142.                           table; it must be explicitly entered. It is
  1143.                           generally the width of the lowercase x.
  1144.  
  1145. Maximum                   The width in font units of the widest character
  1146.                           in the font. Again, this is not calculated from
  1147.                           the user-width table. For fixed-pitch fonts, this
  1148.                           box is not used and is disabled.
  1149.  
  1150. Height                    The height in font units of the character cell,
  1151.                           including internal leading.
  1152.  
  1153. Ascent                    The ascent in font units of the font. The
  1154.                           distance from the top of the character cell to
  1155.                           the baseline of the font.
  1156.  
  1157. With the exception of the width table for proportional fonts, this dialog
  1158. box fills in the remainder of the Microsoft-defined font file header. All
  1159. of these text boxes must be specified accurately.
  1160.  
  1161. There are also two buttons: OK, which carries out the changes in the PFM
  1162. file, and Cancel, which ignores all changes made.
  1163.  
  1164.  
  1165. 3.3.2 The Extended Metrics Dialog Box
  1166.  
  1167. The extended font metrics are a more detailed description of the font's
  1168. geometry. The dialog box contains the following text boxes.
  1169.  
  1170. Text box                 Description
  1171. ---------------------------------------------------------------------------
  1172.  
  1173. Lower Case               The distance in font units from the baseline to
  1174. Ascent                   the top of lowercase ascenders, typically measured
  1175.                          from the lowercase d.
  1176.  
  1177. Descent                  The distance in font units from the baseline to
  1178.                          the bottom of descenders, usually specified for
  1179.                          lowercase p.
  1180.  
  1181. Point Size               The intended size of the font in twips (1/20th of
  1182.                          a point, or 1/1440 of an inch).
  1183.  
  1184. Cap Height               The height in font units of the font's uppercase
  1185.                          characters, usually taken for the character H.
  1186.  
  1187. X Height                 The height in font units of lowercase characters,
  1188.                          usually the height of the lowercase x.
  1189.  
  1190. Slant                    The angle in tenths of a degree clockwise from the
  1191.                          vertical.
  1192.  
  1193. Master Height            The size in device units at which the values in
  1194.                          the extent table are exact.
  1195.  
  1196. Master Units             The Master Height text expressed in font units. If
  1197.                          the two are different, then the device is a linear
  1198.                          scaling device, and the application needs to scale
  1199.                          all values by the ratio of the requested size to
  1200.                          this value.
  1201.  
  1202. Scale                    The minimum and maximum sizes to which a linear
  1203. Min and Max              scaling device can scale a font.
  1204.  
  1205. Orientation              The orientation of the font, which may be either
  1206. Portrait and Landscape   or both.
  1207.  
  1208. The Master Height, Master Units, and Min and Max Scale boxes are used on
  1209. devices that can scale fonts linearly to any size. On devices that do not
  1210. scale fonts, these numbers should all be equal to the value in the Height
  1211. box from the Basic Metrics dialog box.
  1212.  
  1213. All these members come from the EXTTEXTMETRIC structure.
  1214.  
  1215.  
  1216. 3.3.3 The Effects Metrics Dialog Box
  1217.  
  1218. This menu item is disabled (grayed) until you specify the extended metrics.
  1219. The information you can then specify in this dialog box tells the driver
  1220. how to synthesize effects such as underlining and superscripting, while
  1221. allowing for the per-font, per-size customization of these effects. It also
  1222. forms the remainder of the EXTTEXTMETRIC structure in the PFM file.
  1223.  
  1224. Superscripting, subscripting, underlining, double underlining, and
  1225. strikethroughs require two numbers. The vertical position of the effect and
  1226. its size. Offsets are measured downward from the baseline of the font,
  1227. which means that strikeouts and superscripts will generally have negative
  1228. offsets. The size specifies the thickness of lines in font units for the
  1229. line effects, or the height in font units for superscripts and subscripts.
  1230. For double underlines, you may specify the upper and lower lines
  1231. independently.
  1232.  
  1233.  
  1234. 3.4 The Tables Menu
  1235.  
  1236. This popup menu contains three selections: Widths, Kerning Pairs, and
  1237. Kerning Track. Since these are only appropriate for proportional-width
  1238. fonts, they are disabled for fixed-pitch fonts.
  1239.  
  1240. The width table contains the exact specification, per-character, of the
  1241. widths of characters in proportional fonts. Track- and pair-kerning are
  1242. used to fine-tune character spacing.
  1243.  
  1244.  
  1245. 3.4.1 The Width Table Dialog Box
  1246.  
  1247. The Width Table dialog box has a scrollable list box containing all the
  1248. characters and their widths, represented by decimal numbers in font units.
  1249. Notice that, since this table is an absolute requirement for all
  1250. proportional fonts, you must set the font pitch to proportional and the
  1251. first and last characters in the Basics dialog box before entering a width
  1252. table.
  1253.  
  1254. Just above the list box is a label number with an edit control next to it.
  1255. Whenever a character is selected from the list box, the label changes to
  1256. the character's code, and the edit control is changed to its width. The
  1257. width can then be changed.
  1258.  
  1259. To change the width of a character in the width table in the list box, you
  1260. must choose the Width button. If the character is not the last one in the
  1261. font, choosing the Width button, or pressing the ENTER key also causes the
  1262. selection to be advanced to the next character, which enables you to
  1263. quickly enter the entire width table.
  1264.  
  1265.  
  1266. 3.4.2 The Pair Kerning Table Dialog Box
  1267.  
  1268. You can fine-tune character spacing for proportional fonts by using
  1269. pair-kerning. The Pair Kerning Table dialog box consists of a list box
  1270. containing character pairs and the amount of space to insert or delete
  1271. between them. A negative kern amount (given in font units) specifies
  1272. tighter spacing, while a positive amount spreads characters out.
  1273.  
  1274. The three edit controls are for the From and To characters and the kerning
  1275. amount. If you select a kern pair in the list box, the editor displays the
  1276. values in the structure for modification.
  1277.  
  1278. There are three buttons for manipulating the Pair Kerning Table:
  1279.  
  1280. o   Add, which adds the kern pair to the table in the edit controls.
  1281.  
  1282. o   Delete, which removes the selected kern pair from the list box.
  1283.  
  1284. o   Change, which replaces the selected kern pair with the contents of the
  1285.     edit control.
  1286.  
  1287. The Pair Kerning Table is sorted; adding or replacing a pair does not give
  1288. it a particular position in the table.
  1289.  
  1290. As in the other dialog boxes, the OK button carries out the changes in the
  1291. PFM file, and the Cancel button ends the dialog without saving the changes
  1292. to the table.
  1293.  
  1294.  
  1295. 3.4.3 The Track Kerning Table Dialog Box
  1296.  
  1297. You type values into the Track Kerning Table in the same manner as for the
  1298. Pair Kerning Table. There are five text boxes to consider.
  1299.  
  1300. For the kerning degree, negative values specify tighter kerning, and
  1301. positive values specify looser kerning. The minimum size specifies the
  1302. smallest size in font units for which track kerning applies, and the
  1303. maximum size specifies the largest font.
  1304.  
  1305. The minimum amount specifies the amount of track kerning to apply to fonts
  1306. of the minimum size and below. The maximum amount is the track kerning to
  1307. apply to all fonts at least as large as the maximum size.
  1308.  
  1309.  
  1310. 3.5 The Driver Menu
  1311.  
  1312. The PCL printer is currently the only supported printer in the Driver menu.
  1313. The PCL Driver dialog box contains information specific to the PCL driver
  1314. for HP LaserJet-type printers. The text boxes are as follows.
  1315.  
  1316. Text box        Description
  1317. ---------------------------------------------------------------------------
  1318.  
  1319. Symbol Set      Specifies the HP-defined symbol set for a font. (For more
  1320.                 information about the symbol sets, see the Hewlett-Packard
  1321.                 LaserJet Printer documentation.) The following are the
  1322.                 currently defined symbol sets (selected with individual
  1323.                 buttons):
  1324.  
  1325.                  E.C.M.A. 94
  1326.                  Generic 7
  1327.                  Generic 8
  1328.                  ISO Den/Nor
  1329.                  ISO France
  1330.                  ISO Germany
  1331.                  ISO Italy
  1332.                  ISO Spain
  1333.                  ISO Sweden/Finland
  1334.                  ISO U.K.
  1335.                  Kana 8
  1336.                  Line Draw
  1337.                  Math 8
  1338.                  Math Symbols
  1339.                  Roman 8
  1340.                  Roman Ext.
  1341.                  U.S. ASCII
  1342.                  U.S. Legal
  1343.                  User Defined
  1344. Mem Usage       An approximation of the amount of memory in the printer
  1345.                 that the soft font requires. This is given as the following
  1346.                 formula:
  1347.  
  1348.                  ((sum of all character widths + 7)>> 3) * height + 63
  1349. Escape String   This is the escape string you send to the printer to select
  1350.                 the font. It may contain any PCL commands. You may use the
  1351.                 following special sequences to type control characters:
  1352.  
  1353.                  \e - escape (ASCII 27, 0x1b)
  1354.                  \[ - escape (ASCII 27, 0x1b)
  1355.                  \n - line feed (ASCII 10, 0xa)
  1356.                  \r - carriage return (ASCII 13, 0xd)
  1357.                  \xnn - hexadecimal character code
  1358.                  \nnn - octal character code
  1359.                 When the PFM Editor displays an escape string, it converts
  1360.                 all non-ASCII printing characters to the hexadecimal format
  1361.                 \xnn.
  1362.  
  1363. As in the other dialog boxes, the OK button carries out the changes in the
  1364. PFM file, and the Cancel button ends the dialog without saving changes.
  1365.  
  1366.  
  1367. 3.6 Creating PCM Files
  1368.  
  1369. The PCL driver uses Printer Cartridge Metric (PCM) files to define
  1370. cartridges other than built-in Hewlett-Packard cartridges. PCM files are
  1371. essentially a collection of PFM files (one for each font in the cartridge).
  1372.  
  1373. To make a PCM file, you must first create the individual PFM files for each
  1374. of the cartridge fonts. You can create PFM files easily with the Printer
  1375. Font Installer. Simply add the font, which must be in the Hewlett-Packard
  1376. PCL format. The Printer Font Installer will automatically scan the PCL font
  1377. and create the PFM file. Use the PFM Editor to edit the file. Verify all
  1378. the boxes and values. Also, notice that the Printer Font Installer does not
  1379. enter the font escape string. You must do this with the PFM Editor.
  1380.  
  1381. After you have created all the PFM files and saved them in one directory,
  1382. from the File menu, choose the Create PCM File command to display a dialog
  1383. box and prompt you for a PCM filename. Put this file in the same directory
  1384. as its constituent PFM files.
  1385.  
  1386. After you type a filename and choose the OK button, a second dialog box
  1387. appears with the PCM filename in a static control at the top. The first
  1388. edit control in the dialog box enables you to enter the cartridge title,
  1389. which must be a nonempty title (that is, you must fill in the edit
  1390. control). This title is the string placed in the cartridge selection list
  1391. box in the driver's Printer Setup (device-mode) dialog box. Verify that the
  1392. correct font escape string is defined for each PFM file.
  1393.  
  1394. The PFM Editor places a list of PFM files, that are in the same directory
  1395. as the target PCM file, in a list box on the left side of the dialog box.
  1396. You can select one or more of these files and move them to the right-hand
  1397. selected list box by choosing the Select button (or double-clicking a
  1398. filename). You can remove selected PFM files, or place them back in the
  1399. left-hand available list box by selecting filenames in the same manner in
  1400. the right-hand selected list box.
  1401.  
  1402. When you choose the OK button, the PFM files that appear in the right-hand
  1403. list box are placed in the PCM file. To create the PCM file, you must
  1404. select at least one PFM file and have a nonempty title string.
  1405.  
  1406. When the editor creates the PCM file, it also creates a text file in the
  1407. same directory with the same name and the .INI extension. On the first line
  1408. of this initialization file is the title of the cartridge; the list of PFM
  1409. files follows on subsequent lines, one filename per line. Whenever the PCM
  1410. dialog box is chosen, the PFM Editor looks for the .INI file and uses the
  1411. stored data to initialize the title string and the list of selected PFM
  1412. files.
  1413.  
  1414. NOTE  Editing a PFM file will not cause the PCM file to be updated. The PFM
  1415. Editor cannot directly edit PCM files. Therefore, if you make a change in a
  1416. PFM file, you must rebuild the PCM file.
  1417.  
  1418.  
  1419. 3.7 Converting PFM Files for Minidrivers
  1420.  
  1421. If you want to use a file you've created with the PFM Editor with
  1422. minidrivers, you'll need to convert the file using the CVTHPPFM utility.
  1423. You run this utility from the MS-DOS command line.
  1424.  
  1425. Additionally, if you want to convert 3.1 PFM files to use with 3.0 PFM
  1426. files, you can use the CVTHPPFM utility to perform this conversion as well.
  1427.  
  1428.  
  1429. 3.8 The PFM Editor Error Messages
  1430.  
  1431. The following error messages can appear when using the PFM Editor. A brief
  1432. explanation of why the message appears is given after each message.
  1433.  
  1434. Break character not in character set
  1435.  
  1436. The break character must be between the first and last character in the
  1437. character set, inclusive.
  1438.  
  1439. Can't find filename, ignored
  1440.  
  1441. The initialization file for a PCM file contained a reference to a PFM file
  1442. that is not in the same directory, or that does not have the .PFM
  1443. extension.
  1444.  
  1445. Can't open filename, ignored
  1446.  
  1447. The specified PFM file was in the current directory when the list box of
  1448. available PFM files was created. However, when the attempt to write the PCM
  1449. file was made, the PFM file could not be read.
  1450.  
  1451. Can't write the PCM file
  1452.  
  1453. An error occurred while writing to the PCM file, or to the associated
  1454. initialization file.
  1455.  
  1456. Changing the character range will invalidate the width table
  1457.  
  1458. If you enter a width table and then change the first and last characters,
  1459. the width table will no longer be valid. This will not occur if you have a
  1460. specific font in mind when you create a PFM file.
  1461.  
  1462. Couldn't save file filename
  1463.  
  1464. The file specified could not be saved because of an error opening or
  1465. writing the file, attempting to write over a read-only file, or running out
  1466. of disk space.
  1467.  
  1468. Default character not in character set
  1469.  
  1470. The default character must be between the first and last character in the
  1471. character set, inclusive.
  1472.  
  1473. Driver information not specified
  1474.  
  1475. You attempted to save a file that does not contain PCL driver information.
  1476.  
  1477. Error creating the initialization file for filename
  1478.  
  1479. The initialization file corresponding to the given file could not be
  1480. opened.
  1481.  
  1482. Error creating the PCM file filename
  1483.  
  1484. The PCM file could not be opened because of an inappropriate filename (such
  1485. as a nonexistent directory), a preexisting read-only file of the same name,
  1486. or being out of disk space.
  1487.  
  1488. filename contains the wrong driver information version
  1489.  
  1490. This is a warning indicating that while the PFM file appears to be in the
  1491. correct format, the driver-specific information contains a version number
  1492. that this PFM Editor does not support.
  1493.  
  1494. filename contains the wrong header version number
  1495.  
  1496. This is a warning indicating that the PFM header has a version number that
  1497. this PFM Editor does not recognize.
  1498.  
  1499. filename does not contain driver information
  1500.  
  1501. The PFM file does not contain a PCL driver structure.
  1502.  
  1503. filename does not contain extended text metrics
  1504.  
  1505. This is a warning that the PFM file being read into the PFM Editor does not
  1506. contain extended text metrics.
  1507.  
  1508. filename has been modified. Save before continuing?
  1509.  
  1510. This message allows you to save a file or abort an operation before doing
  1511. something that will abandon a modified PFM file, such as choosing the New,
  1512. Open, or Exit commands.
  1513.  
  1514. filename is not a valid file name
  1515.  
  1516. The filename given is invalid because it contains illegal characters or
  1517. syntax errors.
  1518.  
  1519. filename is not a valid PFM file
  1520.  
  1521. The specified file does not contain a PFM file, or the PFM file is either
  1522. corrupted or from the wrong version.
  1523.  
  1524. Proportional font requires a width table
  1525.  
  1526. You attempted to save a PFM file that specifies a proportional font but
  1527. does not contain a width table.
  1528.  
  1529. Unrecognized device devicename
  1530.  
  1531. The PFM contains a device name that the PFM Editor does not recognize. The
  1532. only name recognized currently is PCL/HP LaserJet.
  1533.  
  1534. Width table will need to be reentered
  1535.  
  1536. This is warning indicating that changing your character range invalidates
  1537. your width table.
  1538.  
  1539. Write over original filename?
  1540.  
  1541. A file with the same name as the filename you specified using the Save As
  1542. command already exists. Choose Yes to write over the old file, or No to
  1543. choose a new name.
  1544.  
  1545. Chapter 4  PCL/HP LaserJet Printer Driver
  1546.  
  1547. The Microsoft Windows PCL printer driver supports a wide variety of
  1548. printers including the Hewlett-Packard printers that use Printer Control
  1549. Language (PCL) and fonts. This chapter provides a brief overview of the
  1550. features for the driver and in particular those features new for Windows
  1551. 3.1.
  1552.  
  1553.  
  1554. 4.1 Features for Windows 3.1
  1555.  
  1556. The printer driver for HP LaserJet printers that use PCL includes the
  1557. following new features for Windows 3.1:
  1558.  
  1559. o   Memory Tracking. This allows users to manage the memory usage on the
  1560.     printer. This especially useful when using multiple downloadable fonts.
  1561.  
  1562. o   TrueType as Graphics. This allows for drawing glyphs using outlines
  1563.     rather then downloaded glyphs.
  1564.  
  1565. o   User-Specified Position and Thickness for TrueType Fonts. This allows
  1566.     for user control of the appearance of glyphs from TrueType fonts.
  1567.  
  1568. o   ResetDC Function. This allows users to change the page orientation or
  1569.     paper tray in the middle of a print job.
  1570.  
  1571. o   Standard Dialog Boxes. This provides a consistent user interface
  1572.     between printer drivers and applications.
  1573.  
  1574.  
  1575. 4.2 Soft Fonts and Cartridges
  1576.  
  1577. Because of the large number of downloadable and cartridge fonts available
  1578. for HP LaserJet printers, the driver can only have a few of these fonts
  1579. built into it. The driver supports the installation of additional fonts by
  1580. supplying a utility called the Printer Font Installer.
  1581.  
  1582. The Printer Font Installer adds support for soft fonts and font cartridges
  1583. by installing PFM and PCM files and associated screen and soft font files.
  1584. The font cartridge manufacturer can use the PFM Editor to create PFM and
  1585. PCM files to accompany the font cartridge, or create these files on their
  1586. own.
  1587.  
  1588.  
  1589. 4.3 PFM Files for HP Printers that Use PCL
  1590.  
  1591. The Printer Font Metrics (PFM) files for PCL printers have the following
  1592. form:
  1593.  
  1594.     PFMHEADER     Header;          /* font header */
  1595.     WORD          WidthTable[];    /* variable-width fonts only */
  1596.     PFMEXTENSION  Extensions;      /* extensions */
  1597.     char          DeviceName[];    /* printer device name */
  1598.     char          FaceName[];      /* font name */
  1599.     EXTTEXTMETRIC ExtTextMetrics;  /* extended-text metrics (optional)*/
  1600.     WORD          ExtentTable[];   /* unscaled character widths */
  1601.     DRIVERINFO    DriverInfo;      /* driver-specific info (optional)*/
  1602.     PAIRKERN      KerningPairs[];  /* pair-kerning table (optional) */
  1603.     KERNTRACK     KerningTracks[]; /* track-kerning table (optional) */
  1604. The width table is present if the dfPixWidth member is zero, which
  1605. indicates a variable-width font. (Otherwise, for fixed-width fonts the
  1606. width of all the characters in the font equals the value in the dfPixWidth
  1607. member and no width table is given.) The width table is an array of words
  1608. containing the widths in device units of characters in the range from
  1609. dfFirstChar to dfLastChar. The width of a character c can be located using
  1610. the formula:
  1611.  
  1612.     width = WidthTable [c - dfFirstChar]
  1613. The size of the table is dfLastChar - dfFirstChar + 2 words. The last word
  1614. is not used and is set to zero; it should be present for compatibility with
  1615. the Windows screen-font file format.
  1616.  
  1617. If your font contains kern pairs, you must fill in the EXTTEXTMETRIC
  1618. structure to indicate the number of kern pairs. Do not leave the other
  1619. members blank; fill them in with reasonable values in the event an
  1620. application uses them.
  1621.  
  1622. Eventually, there will be PFM files that describe scalable PCL fonts. To
  1623. guarantee that your raster fonts are never interpreted as scalable fonts,
  1624. make sure that the members for scaling information in the EXTTEXTMETRIC
  1625. structure indicate a nonscaling font:
  1626.  
  1627.     etmMasterHeight = etmMasterUnits = etmMinScale = etmMaxScale =
  1628.     dfPixHeight
  1629. The PCL driver for Windows supports five possible character translations.
  1630. It determines which internal translation table to use based upon the value
  1631. of the symbolSet member of the xtbl member. Following are the symbol sets
  1632. and their corresponding translation tables.
  1633.  
  1634. Symbol set      Translation table
  1635. ---------------------------------------------------------------------------
  1636.  
  1637. epsymECMA94     ECMA94_Trans
  1638.  
  1639. epsymGENERIC7   GENERIC7_Trans
  1640.  
  1641. epsymGENERIC8   GENERIC8_Trans
  1642.  
  1643. epsymRoman8     Roman8_Trans
  1644.  
  1645. epsymUSASCII    USASCII_Trans
  1646.  
  1647. The translation tables are stored in the TRANS.H file. For epsymRoman8,
  1648. epsymUSASCII, and epsymECMA94, the driver attempts to derive Windows ANSI
  1649. from the symbol set. For epsymGENERIC8 and epsymGENERIC7, the driver simply
  1650. lets an 8- or 7-bit symbol set pass through to the printer unchanged.
  1651.  
  1652. The driver assumes the width table in the PFM file contains the widths of
  1653. the characters after translation. If you set epsymRoman8, epsymUSASCII, or
  1654. epsymECMA94 for the symbolSet member of xtbl member, you must use the
  1655. appropriate translation table in TRANS.H to do an inverse translation when
  1656. building the width table.
  1657.  
  1658. Following is a sample of the translation table for epsymRoman8:
  1659.  
  1660.     #define HP_DF_CH ((BYTE) 0x7F)
  1661.  
  1662.     unsigned  char  <+> Roman8_Trans[] = {
  1663.             HP_DF_CH, NULL,                 /*  80  */
  1664.             HP_DF_CH, NULL,                 /*  81  */
  1665.             ...
  1666.             'Y' ,     0xa8,         /*  dd  */
  1667.             0xf0,     NULL,         /*  de  */
  1668.             0xde,     NULL,         /*  df  */
  1669.             0xc8,     NULL,         /*  e0  */
  1670.             ...
  1671.             0xef,     NULL  };      /*  ff  */
  1672. The table translates characters in the range from 128 to 255. The driver
  1673. uses the character it receives from the application to index into the
  1674. translation table. It replaces the character with the first entry in the
  1675. table. If the second entry is not a NULL entry, it overstrikes the first
  1676. character with the second character.
  1677.  
  1678. For example, when the driver detects character 0xDD (that is, the Y-acute
  1679. (Y) in the text stream), the driver will output a capital Y overstruck by
  1680. the acute accent. When the overstrike character is present, the driver
  1681. guarantees that the width of the character pair equals the width of the
  1682. first character.
  1683.  
  1684. If the driver-specific data structure is not present, or the symbolSet
  1685. member of xtbl member equals a symbol set other than epsymRoman8,
  1686. epsymUSASCII, epsymECMA94, epsymGENERIC8, or epsymGENERIC7, the driver will
  1687. use the epsymGENERIC8 translation as a default if the dfLastChar member of
  1688. the PFMHEADER structure is greater than 127 (an 8-bit font). Otherwise, it
  1689. will use the epsymGENERIC7 translation.
  1690.  
  1691.  
  1692. 4.4 PFM Files for Scalable PCL Fonts
  1693.  
  1694. Currently, the PCL driver for Windows supports only nonscaling PCL fonts.
  1695. The driver will detect scalable fonts by examining the etmMinScale and
  1696. etmMaxScale members in the EXTTEXTMETRIC structure. If they are equal, it
  1697. will assume a nonscaling font.
  1698.  
  1699. A PFM file for scalable PCL font must have the following form:
  1700.  
  1701.     PFMHEADER     Header;          /* font header */
  1702.     WORD          WidthTable[];    /* variable-width fonts only */
  1703.     PFMEXTENSION  Extensions;      /* extensions */
  1704.     char          DeviceName[];    /* printer device name */
  1705.     char          FaceName[];      /* font face name */
  1706.     EXTTEXTMETRIC ExtTextMetrics;  /* extended text metrics (optional)*/
  1707.     WORD          ExtentTable[];   /* unscaled character widths */
  1708.     DRIVERINFO    DriverInfo;      /* driver-specific info (optional)*/
  1709.     PAIRKERN      KerningPairs[];  /* pair-kerning table (optional) */
  1710.     KERNTRACK     KerningTracks[]; /* track-kerning table (optional) */
  1711. In the PFMHEADER structure, the dfPixHeight member must contain the height
  1712. of a default font size (same as 12 points).
  1713.  
  1714. For variable-width fonts, the width-table array contains widths for the
  1715. default point size.
  1716.  
  1717. In the DRIVERINFO structure, the epEscape member must be nonzero (that is,
  1718. a printer escape must be provided).
  1719.  
  1720. Optionally, pair-kern and track-kern tables may be provided. The default
  1721. font size and width table should be provided for consistency with the
  1722. existing driver. If they differ and the dfExtMetricsOffset member is not
  1723. NULL, the driver will assume a scalable font.
  1724.  
  1725. An extent table must be supplied for scalable fonts. The extent table is an
  1726. array of words containing the unscaled widths of the characters. The range
  1727. of the table should be from dfFirstChar to dfLastChar. The size of the
  1728. table should be dfLastChar - dfFirstChar + 1 word. The driver will scale
  1729. the characters using the formulas based on the etmMasterHeight and
  1730. etmMasterUnits members.
  1731.  
  1732. The driver will not support the ENABLERELATIVEWIDTHS escape, as this would
  1733. be difficult to support with scaling and nonscaling fonts intermixed
  1734. (scaling fonts use font units; nonscaling fonts use device units).
  1735.  
  1736. The driver will assume the dfVertRes member equals 300 dpi. Remember that
  1737. etmMasterHeight, etmMinScale, and etmMaxScale must be expressed in device
  1738. units.
  1739.  
  1740. If the intended printer does not force its widths to 300 dpi units (that
  1741. is, etmMasterUnits does not equal etmMasterHeight), the driver will attempt
  1742. to correct for roundoff error between the printer's units and the driver's
  1743. imposed 300 dpi units. The driver will correct for the error by maintaining
  1744. a running roundoff value during output of a single line of text.
  1745.  
  1746. You must provide the driver-specific data structure. As described earlier,
  1747. the symbolSet member of xtbl member must be equal to epsymRoman8,
  1748. epsymUSASCII, epsymECMA94, epsymGENERIC8, or epsymGENERIC7. Use an inverse
  1749. translation of the tables provided in the TRANS.H file to build the extent
  1750. table if you select epsymRoman8, epsymUSASCII, or epsymECMA94.
  1751.  
  1752. You must also provide an escape string pointed to by the epEscape member in
  1753. the driver-specific data structure. The driver will send this escape to the
  1754. printer to select the font.
  1755.  
  1756. If pair or track kerns exist, they should use the same units as the
  1757. character widths in the extent table.
  1758.  
  1759.  
  1760. 4.5 Permanent Soft Fonts
  1761.  
  1762. Permanent soft fonts are downloaded to the printer when the printer is
  1763. turned on, and remain there until the printer is turned off. Permanent
  1764. fonts are downloaded to the printer sometime after power up. The driver
  1765. does not have to be active, nor does Windows need to be running for
  1766. permanent fonts to be downloaded to the printer. In fact, permanent fonts
  1767. are typically downloaded to the printer when the user first turns on the
  1768. computer.
  1769.  
  1770.  
  1771. 4.6 Initialization Settings for PCL Printers
  1772.  
  1773. The printer driver for HP printers that use PCL uses a number of sections
  1774. and settings in the WIN.INI file. Users set these settings by using the
  1775. driver's Printer Setup dialog box or the Printer Font Installer. Normally,
  1776. the user should have no need to modify these settings directly.
  1777.  
  1778. The most important settings for the driver are the softfonts and softfontn
  1779. settings. These set the number of and define the PFM or PCM files for the
  1780. soft fonts and cartridges for the printer. The Printer Font Installer sets
  1781. these settings when the user installs fonts. However, notice that the
  1782. driver has no control over the order of the settings in the WIN.INI file,
  1783. and the driver does not currently delete settings from the WIN.INI file.
  1784.  
  1785. The order of settings in the WIN.INI file is insignificant and has no
  1786. effect on the operation of the driver. If the driver does not delete an
  1787. entire entry line from WIN.INI, it removes everything to the right of the
  1788. equal sign (=). The title text to the left of the equal sign remains there
  1789. until the user manually removes it.
  1790.  
  1791. The Windows Printer Font Installer, used in conjunction with the HP
  1792. LaserJet driver that uses PCL, also requires these settings that associated
  1793. permanently downloaded fonts with their corresponding PFM files. The
  1794. following shows the general form for these settings:
  1795.  
  1796.     C:\PCLFONTS\HVPB0140.PFM=C:\PCLFONTS\HV140BPN.USP
  1797.     C:\PCLFONTS\TRPR0120.PFM=C:\PCLFONTS\TR120BPN.USP
  1798. The Printer Font Installer in the driver for HP printers that use PCL uses
  1799. these settings to preserve the filenames of the permanently downloaded
  1800. fonts. If the fonts are changed to temporary fonts, these settings are
  1801. removed and the soft font filenames are added with the appropriate
  1802. softfontn setting.
  1803.  
  1804. Chapter 5  Printer Font Installer
  1805.  
  1806. The Printer Font Installer, an important part of the driver for the
  1807. Hewlett-Packard LaserJet printers that use Printer Control Language (PCL),
  1808. installs screen fonts, downloadable fonts, PFM files, and PCM files from
  1809. floppy disk. Font vendors who distribute fonts on floppy disk can use the
  1810. installer to install their fonts. This chapter describes the steps required
  1811. to prepare distribution disks for use with the Printer Font Installer.
  1812.  
  1813. The Printer Font Installer is in a separate dynamic-link library (DLL)
  1814. called FINSTALL.DLL.
  1815.  
  1816.  
  1817. 5.1 Printer-Font Installation
  1818.  
  1819. The HP LaserJet printer driver that uses PCL starts the Printer Font
  1820. Installer whenever the user chooses the Fonts button in the driver's Setup
  1821. dialog box. If the user then chooses the Add Font button to add fonts, the
  1822. installer prompts for a disk containing the fonts to install as well as
  1823. additional files.
  1824.  
  1825. The installer then searches the specified disk for the printer-font
  1826. directory file (FINSTALL.DIR). If the file exists, it reads the file and
  1827. installs the fonts specified in it. If there is no printer-font directory
  1828. file, the installer performs the following actions:
  1829.  
  1830. o   If a file on the disk exists with the .LBL extension, the installer
  1831.     assumes the FINSTALL.DIR file is on another disk. It prompts the user
  1832.     to switch disks, while allowing the user the option to read the disk
  1833.     without the directory file.
  1834.  
  1835. o   If there is no .LBL file or the user chooses the first option, the
  1836.     installer assumes the directory file does not exist. It then scans the
  1837.     disk looking for downloadable font files.
  1838.  
  1839. When the installer has to scan the disk for soft fonts, it opens each file
  1840. on the disk and looks for the header of a downloadable font file. If it
  1841. finds the header, it derives the font name and point size, and displays
  1842. this to the user in the list box of soft fonts available for installation.
  1843. When the font is installed, the installer will generate a PFM file from the
  1844. downloadable font file. Without the FINSTALL.DIR file, it will ignore any
  1845. PFM files already on the disk.
  1846.  
  1847.  
  1848. 5.2 Printer-Font Directory File
  1849.  
  1850. The font-installation directory file, FINSTALL.DIR, describes the contents
  1851. of the distribution disks for a font package. The Printer Font Installer
  1852. uses this information to locate and install the files associated with
  1853. screen and downloadable fonts.
  1854.  
  1855. The FINSTALL.DIR file typically consists of one or more entries that define
  1856. logical disk names, font families, and cartridges. The file can also
  1857. contain comments.
  1858.  
  1859. The DRIVE statement defines the logical disk names used in other entries in
  1860. the file. DRIVE statements must appear before any entries that use the
  1861. associated disk names. It is highly recommended that a logical drive be
  1862. defined for each floppy disk in the distribution package, and that all
  1863. files referenced be preceded by a logical drive ID.
  1864.  
  1865. The FAMILY statement defines the screen fonts that correspond to
  1866. downloadable fonts, and the CARTRIDGE statement defines the screen fonts
  1867. that correspond to a given cartridge. Any number of these statements can be
  1868. given in the file, and each statement can specify any number of screen
  1869. fonts, downloadable fonts, and cartridges.
  1870.  
  1871. The FINSTALL.DIR file should be placed on the first disk in the
  1872. distribution set, or on a disk that is clearly marked. If the installer
  1873. does not find the file on the first disk it searches, it will assume that
  1874. no such file exists use a default procedure for installing fonts.
  1875.  
  1876. The following example illustrates the format of a FINSTALL.DIR file:
  1877.  
  1878.     /* Acme Corporation's font package.
  1879.      *
  1880.      * This package consists of two floppy disks: One
  1881.      * containing the Acme Ace soft font set and the other
  1882.      * containing the Acme Sparrow soft font set.
  1883.      */
  1884.  
  1885.     /* Logical drives
  1886.      */
  1887.     DRIVE ACE1: = ACESET1.LBL, "Ace set (disk 1 of 2)"
  1888.     DRIVE SPARROW1: = SPRWSET1.LBL, "Sparrow set (disk 2 of 2)"
  1889.  
  1890.     /* Ace set */
  1891.     FAMILY "Ace" {
  1892.  
  1893.         /* Screen fonts */
  1894.         1:1 = "Acme Ace 1:1", ACE1:ACE11.FON
  1895.         4:3 = "Acme Ace 4:3", ACE1:ACE43.FON
  1896.  
  1897.         /* Printer fonts */
  1898.         "Ace 36pt"      = P,ACE1:ACE36RPN.USP,ACE1:ACE36RPP.PFM
  1899.         "Ace 36pt bold" = P,ACE1:ACE36BPN.USP,ACE1:ACE36RPP.PFM
  1900.     }
  1901.  
  1902.     /* Sparrow set */
  1903.     FAMILY "Sparrow" {
  1904.  
  1905.         /* Screen fonts */
  1906.         1:1 = "Acme Sparrow 1:1", SPARROW1:SPAROW11.FON
  1907.         4:3 = "Acme Sparrow 4:3", SPARROW1:SPAROW43.FON
  1908.  
  1909.         /* Printer fonts */
  1910.         "Sparrow 36pt"      = P,SPARROW1:SPR36RPN.USP,SPARROW1:SPR36RPP.PFM
  1911.         "Sparrow 36pt bold" = P,SPARROW1:SPR36BPN.USP,SPARROW1:SPR36RPP.PFM
  1912.     }
  1913. For more information about the DRIVE, FAMILY, and CARTRIDGE statements, see
  1914. the Section 5.7, Directory File Reference, later in this chapter.
  1915.  
  1916.  
  1917. 5.3 Setting Up Fonts for Downloading
  1918.  
  1919. The Printer Font Installer allows the user to specify whether a font should
  1920. be set up for permanent or temporary downloading. The Permanent and
  1921. Temporary options in the dialog box specify which action to take.
  1922.  
  1923. When a user changes a font from temporary to permanent status, the
  1924. installer displays a warning message. This message reminds the user that
  1925. permanent fonts take up printer memory, and therefore only the most
  1926. frequently used fonts should be permanently downloaded to the printer.
  1927.  
  1928. When the user exits the installer, the installer prompts the user for the
  1929. download style. If the user selects the Download Now option, the installer
  1930. will send a print job consisting of the permanent fonts to the printer. If
  1931. the user selects the Download at Startup option, the installer will build a
  1932. batch file that downloads the fonts to the printer and edits the
  1933. AUTOEXEC.BAT file to call the batch file. The user may select both, one, or
  1934. none of these options. As long as the user has permanent soft fonts, the
  1935. installer displays this message every time the user exits the installer.
  1936.  
  1937. As part of downloading permanent fonts, the installer sends a delete all
  1938. fonts escape to the printer. This forces the printer to delete all
  1939. permanently downloaded fonts. After downloading the new fonts, a banner
  1940. page (in portrait format) is printed that shows the fonts that have been
  1941. downloaded. Portrait fonts are shown in the typeface that was downloaded.
  1942.  
  1943.  
  1944. 5.3.1 Downloading
  1945.  
  1946. If you choose Download Now (that is, upon exiting the installer) it is not
  1947. a difficult task for the driver. The installer simply opens a Windows print
  1948. job and sends down the fonts. Downloading fonts at startup (that is, when
  1949. the user turns on the machine) is more complex.
  1950.  
  1951. To set up the downloading of permanent fonts at startup, the installer
  1952. performs the following tasks:
  1953.  
  1954. 1.  Writes an executable program that prompts the user to download fonts.
  1955.  
  1956. 2.  Creates a batch that downloads the fonts and writes out the banner page.
  1957.  
  1958. 3.  Edits the AUTOEXEC.BAT file to call the download batch file.
  1959.  
  1960. The executable program presents the user with a prompt to choose whether or
  1961. not to download permanent soft fonts. The program is stored in the driver's
  1962. resources and written to its own file when the installer is setting up
  1963. fonts for permanent downloading. The downloading batch file calls this
  1964. executable program.
  1965.  
  1966. The program displays the following prompt:
  1967.  
  1968.     Download PCL fonts to port name? [y/n]
  1969. If the user responds no, the program returns 1 and the batch file tests the
  1970. ERRORLEVEL. The program then exits without downloading fonts.
  1971.  
  1972. If the user responds yes, the program returns an ERRORLEVEL of zero, and
  1973. the batch file proceeds to download fonts. The batch file is called from
  1974. the user's AUTOEXEC.BAT file. The installer edits the AUTOEXEC.BAT file and
  1975. appends the following strings to the file:
  1976.  
  1977.     command /c C:\PCLFONTS\SFLPT1.BAT
  1978. The string that calls the download batch file uses the MS-DOS command /c
  1979. option. This enables MS-DOS to suspend execution of the AUTOEXEC.BAT file
  1980. to carry out the downloading of file, then return to the execution of the
  1981. AUTOEXEC.BAT file. Without command /c, MS-DOS would not return to executing
  1982. the AUTOEXEC.BAT file (that is, any commands after the line in the
  1983. AUTOEXEC.BAT file would not be executed).
  1984.  
  1985. If a user sets up fonts for permanent downloading, but they are not being
  1986. downloaded to the printer, the commands in the AUTOEXEC.BAT file are
  1987. probably not being executed. The problem may be solved by moving the
  1988. commands in the AUTOEXEC.BAT file.
  1989.  
  1990. Although the entry the installer creates in the AUTOEXEC.BAT file may be
  1991. moved in the file, it should never be modified. This is because the
  1992. installer looks for the entry and modifies it if the user changes the fonts
  1993. from permanent download to temporary. In this case, the installer inserts a
  1994. rem command at the beginning of the entry. This has the effect of disabling
  1995. the download entry without deleting it. If the user once again enters the
  1996. installer and makes some fonts permanent, the installer will locate the
  1997. entry in the AUTOEXEC.BAT file and remove the rem command.
  1998.  
  1999.  
  2000. 5.4 PFM File Generator
  2001.  
  2002. The Printer Font Metrics (PFM) file generator creates PFM files whenever
  2003. the installer locates downloadable font files, but fails to locate a
  2004. FINSTALL.DIR file. The installer assumes it will have to build PFM files
  2005. from the downloadable font files. It reads the header from the font file
  2006. plus the widths of each individual character and uses that information to
  2007. build the PFM file.
  2008.  
  2009. Please notice that when the installer scans a disk for fonts and there is
  2010. no FINSTALL.DIR file, it will ignore any PFM files already on the disk and
  2011. will attempt to generate PFM files from the font files. It will also
  2012. recognize cartridge PCM files.
  2013.  
  2014. It is highly recommended that font manufacturers provide their own PFM
  2015. files because vendor-supplied PFM files will more accurately represent the
  2016. font than PFM files generated by the PFM file generator.
  2017.  
  2018.  
  2019. 5.4.1 Generated PFM File Names
  2020.  
  2021. The PFM file generator builds the following PFM filename.
  2022.  
  2023. Value     Meaning
  2024. ---------------------------------------------------------------------------
  2025.  
  2026. 1, 2      First two characters from the font filename.
  2027.  
  2028. 3         P, L, or X for portrait, landscape, or both orientations.
  2029.  
  2030. 4         B, R, I, or E for bold, roman, italic, or bold/italic (enhanced).
  2031.  
  2032. 5, 6, 7   Point size in points.
  2033.  
  2034. 8         Magic number.
  2035.  
  2036. The magic number is used by the installer to ensure that the filename is
  2037. unique. It starts out at zero. If a file already exists by that name, it is
  2038. incremented to 1. The installer continues to increment the number to 9,
  2039. then A through Z. If it fails to find a unique filename out of the 36
  2040. possibilities, then it will not build the PFM file and reports a Cannot
  2041. build PFM file error message.
  2042.  
  2043.  
  2044. 5.4.2 PFM Data from Font Data
  2045.  
  2046. The installer's PFM generator derives the PFM file from the data in the
  2047. downloadable font file. The following sections list where the data comes
  2048. from for each member in the PFM file structures.
  2049.  
  2050.  
  2051. 5.4.2.1 PFMHEADER Structure
  2052.  
  2053. The installer derives the PFM header from the downloaded file as follows.
  2054.  
  2055. Member               Description
  2056. ---------------------------------------------------------------------------
  2057.  
  2058. dfVersion            256.
  2059.  
  2060. dfSize               Size of file.
  2061.  
  2062. dfType               128.
  2063.  
  2064. dfPoints             Height of the font in points (height from header *
  2065.                      72/1200).
  2066.  
  2067. dfVertRes            300.
  2068.  
  2069. dfHorizRes           300.
  2070.  
  2071. dfAscent             Baseline position from font header.
  2072.  
  2073. dfInternalLeading    (Cell height - height + 2)/4 from font header.
  2074.  
  2075. dfExternalLeading    (height/4) - baseline from font header.
  2076.  
  2077. dfItalic             Set if the style byte in the header = 1.
  2078.  
  2079. dfUnderline          0.
  2080.  
  2081. dfStrikeOut          0.
  2082.  
  2083. dfWeight             Derived from stroke weight.
  2084.  
  2085. dfCharSet            Based upon HP symbol set.
  2086.  
  2087. dfPixWidth           If variable width.
  2088.  
  2089. dfPixHeight          Cell height from the font header.
  2090.  
  2091. dfPitchAndFamily     Pitch bit is set if fixed pitch.
  2092.  
  2093. dfAvgWidth           Average of all the character widths (cursor move).
  2094.  
  2095. dfMaxWidth           Maximum of all the character widths (cursor move).
  2096.  
  2097. dfFirstChar          First character in the font file.
  2098.  
  2099. dfLastChar           Last character in the font file.
  2100.  
  2101. dfDefaultChar        127 - first character.
  2102.  
  2103. dfBreakChar          32 - first character.
  2104.  
  2105. dfWidthBytes         0.
  2106.  
  2107. dfDevice             Offset from beginning of file to device string PCL/HP
  2108.                      LaserJet.
  2109.  
  2110. dfFace               Offset from beginning of file to font name.
  2111.  
  2112. dfBitsPointer        0.
  2113.  
  2114. dfBitsOffset         0.
  2115.  
  2116. dfCharOffset         If variable pitch.
  2117.  
  2118. dfSizeFields         Size of this part of the PFM structure.
  2119.  
  2120. dfExtMetricsOffset   Offset from beginning of file to EXTTEXTMETRIC
  2121.                      structure.
  2122.  
  2123. dfExtentTable        0.
  2124.  
  2125. dfOriginTable        0.
  2126.  
  2127. dfPairKernTable      0.
  2128.  
  2129. dfTrackKernTable     0.
  2130.  
  2131. dfDriverInfo         Offset from beginning of file to DRIVERINFO
  2132.                      (driver-specific) structure.
  2133.  
  2134. dfReserved           0.
  2135.  
  2136. The installer derives the Windows weight value from the weight value in the
  2137. font file header as follows.
  2138.  
  2139. Hewlett-Packard weight   Windows weight
  2140. ---------------------------------------------------------------------------
  2141.  
  2142. -7                       100 (Thin)
  2143.  
  2144. -6                       100 (Thin)
  2145.  
  2146. -5                       200 (Extra light)
  2147.  
  2148. -4                       200 (Extra light)
  2149.  
  2150. -3                       300 (Light)
  2151.  
  2152. -2                       300 (Light)
  2153.  
  2154. -1                       400 (Normal
  2155.  
  2156. 0                        400 (Normal)
  2157.  
  2158. 1                        500 (Medium)
  2159.  
  2160. 2                        600 (Semi-bold)
  2161.  
  2162. 3                        700 (Bold)
  2163.  
  2164. 4                        700 (Bold)
  2165.  
  2166. 5                        800 (Extra bold)
  2167.  
  2168. 6                        800 (Extra bold)
  2169.  
  2170. 7                        900 (Heavy)
  2171.  
  2172. The installer determines the Windows character set (dfCharSet) and the type
  2173. of translation (in the driver-specific structure, the symbolSet member of
  2174. the xtbl member) from the symbol set field in the font file.
  2175.  
  2176. ---------------------------------------------------------------------------
  2177. Hewlett-Packard symbol set   Windows character set   Translation
  2178. ---------------------------------------------------------------------------
  2179.  
  2180. 8U (Roman-8)                 0 (ANSI)                Roman-8
  2181.  
  2182. 0U (USASCII)                 0 (ANSI)                USASCII
  2183.  
  2184. 11Q                          0N (ECMA-94)            0 (ANSI)
  2185.  
  2186. 8M (Math-8)                  180 (Math-8)            8-bit pass through
  2187.  
  2188. 15U (PI Font)                181 (PI Font)           8-bit pass through
  2189.  
  2190. 0B (LineDraw)                182 (LineDraw)          7-bit pass through
  2191.  
  2192. 4Q (PC Line)                 183 (PC Line)           7-bit pass through
  2193.  
  2194. 0B (TaxLnDrw)                184 (Tax Line)          7-bit pass through
  2195.  
  2196. 1U (US Legal)                185 (US Legal)          7-bit pass through
  2197.  
  2198. All others                   0 (ANSI)                7- or 8-bit pass
  2199.                                                      through
  2200.  
  2201. ---------------------------------------------------------------------------
  2202.  
  2203. For the generic case, the installer checks the font type byte in the font
  2204. header. If it is nonzero, the font uses an 8-bit pass through; if the type
  2205. is zero, the font uses a 7-bit pass through.
  2206.  
  2207.  
  2208. 5.4.2.2 EXTTEXTMETRIC Structure
  2209.  
  2210. The installer derives extended text metrics from the download header file
  2211. as follows.
  2212.  
  2213. Member                          Meaning
  2214. ---------------------------------------------------------------------------
  2215.  
  2216. etmCapHeight                    Baseline from header - dfInternalLeading.
  2217.  
  2218. etmDoubleLowerUnderlineOffset   The etmUnderlineOffset member.
  2219.  
  2220. etmDoubleLowerUnderlineWidth    The etmDoubleUpperUnderlineWidth member.
  2221.  
  2222. etmDoubleUpperUnderlineOffset   etmUnderlineOffset + etmUnderlineWidth * 2.
  2223.  
  2224. etmDoubleUpperUnderlineWidth    The etmUnderlineWidth member.
  2225.  
  2226. etmKernPairs                    0.
  2227.  
  2228. etmKernTracks                   0.
  2229.  
  2230. etmLowerCaseAscent              Top offset from character record for 'd';
  2231.                                 left offset if landscape font.
  2232.  
  2233. etmLowerCaseDescent             Character width - left offset from
  2234.                                 character record for 'p'; height - top if
  2235.                                 landscape font.
  2236.  
  2237. etmMasterHeight                 Cell height from font file header.
  2238.  
  2239. etmMasterUnits                  The etmMasterHeight member.
  2240.  
  2241. etmMaxScale                     The etmMasterHeight member.
  2242.  
  2243. etmMinScale                     The etmMasterHeight member.
  2244.  
  2245. etmOrientation                  2 if orientation byte set in header; 1 if
  2246.                                 not.
  2247.  
  2248. etmPointSize                    Cell height *1440 / 300 from font file
  2249.                                 header.
  2250.  
  2251. etmSize                         Size of the EXTTEXTMETRIC structure.
  2252.  
  2253. etmSlant                        0.
  2254.  
  2255. etmStrikeOutOffset              Left offset - etmStrikeOutWidth from
  2256.                                 character record for '-'; top offset -
  2257.                                 etmStrikeOutWidth if landscape font.
  2258.  
  2259. etmStrikeOutWidth               Character width from record for '-';
  2260.                                 character height if landscape font.
  2261.  
  2262. etmSubScript                    Cell height from header.
  2263.  
  2264. etmSubScriptSize                Cell height from header.
  2265.  
  2266. etmSuperScript                  etmCapHeight - etmXHeight.
  2267.  
  2268. etmSuperScriptSize              Cell height from header.
  2269.  
  2270. etmUnderlineOffset              Top offset from character record for '_';
  2271.                                 left offset if landscape font.
  2272.  
  2273. etmUnderlineWidth               Character width from character record for
  2274.                                 '_'; character height if landscape font.
  2275.  
  2276. etmXHeight                      Top offset from character record for 'x';
  2277.                                 left offset if landscape font.
  2278.  
  2279.  
  2280. 5.4.2.3 DRIVERINFO Structure
  2281.  
  2282. The generator derives driver-specific information from the download width
  2283. tables and symbol set as follows.
  2284.  
  2285. Member              Meaning
  2286. ---------------------------------------------------------------------------
  2287.  
  2288. epEscape            0.
  2289.  
  2290. epMemUsage          ((sum of all character widths + 7) >> 3) * height + 63.
  2291.  
  2292. epSize              Size of the DRIVERINFO structure.
  2293.  
  2294. epVersion           1.
  2295.  
  2296. firstchar of xtbl   0.
  2297.  
  2298. lastchar of xtbl    0.
  2299.  
  2300. len of xtbl         0.
  2301.  
  2302. offset of xtbl      0.
  2303.  
  2304. symbolSet of xtbl   Based upon font symbol set.
  2305.  
  2306.  
  2307. 5.4.3 Regenerating PFM Files
  2308.  
  2309. In some situations, such as when the user reinstalls existing fonts without
  2310. the aid of the FINSTALL.DIR file, the installer automatically protects
  2311. against generating duplicate PFM files. There are two potential situations:
  2312.  
  2313. o   The user reinstalls fonts with PFM files that were initially generated
  2314.     by the installer.
  2315.  
  2316. o   The user reinstalls fonts that were initially provided by the font
  2317.     vendor (that is, either on the distribution disks, or built by a
  2318.     utility provided by the font vendor).
  2319.  
  2320. To reinstall fonts, the user starts the Printer Font Installer, chooses the
  2321. Add Fonts button, and directs the installer to read font information from
  2322. the directory containing already installed fonts. Then the user installs
  2323. fonts into the same directory. The installer prompts the user if fonts
  2324. should be replaced. If the user responds yes, the installer proceeds to
  2325. replace every font.
  2326.  
  2327. The installer provides a unique name for each PFM file. In this situation,
  2328. the installer would give a unique name to a PFM file that was a duplicate
  2329. of an existing PFM file. For example, suppose the first time a user
  2330. installed a font, the installer generated a PFM filename XYZ0.PFM. When the
  2331. user reinstalled the font, the installer would generate a second, identical
  2332. PFM file named XYZ1.PFM.
  2333.  
  2334. To prevent duplicate PFM files on the disk, the installer contains a
  2335. protection mechanism. If the magic number in the PFM filename is not zero,
  2336. then the installer compares the contents of the PFM file to the other PFM
  2337. files sharing the same name. If it finds a duplicate, it erases the PFM
  2338. file it just built and uses the already existing PFM file.
  2339.  
  2340. This mechanism prevents the installer from placing duplicate PFM files on
  2341. the disk. However, it does not address duplicate names when PFM files were
  2342. originally supplied by the font vendor.
  2343.  
  2344. NOTE  If the user originally installs fonts provided by a font vendor and
  2345. then reinstalls without use of an FINSTALL.DIR file, the installer will
  2346. replace the vendor-supplied PFM files with its own generated PFM files. It
  2347. does not remove the PFM files from disk; rather it adds its own PFM files
  2348. and uses them. Because the installer's PFM generator is not as accurate as
  2349. the font vendor's PFM files, the installer may actually end up renaming the
  2350. fonts, which causes confusion for the user.
  2351.  
  2352. The user should never reinstall soft fonts from and to the same directory
  2353. without the aid of an FINSTALL.DIR file. Because the installer contains the
  2354. ability to automatically generate an FINSTALL.DIR file of the already
  2355. loaded fonts, there really is no reason for reinstalling fonts without the
  2356. use of an FINSTALL.DIR file.
  2357.  
  2358.  
  2359. 5.5 Developing the FINSTALL.DIR File
  2360.  
  2361. The Printer Font Installer provides features to help you build, test, and
  2362. debug the FINSTALL.DIR file. The following sections describes these
  2363. features in detail.
  2364.  
  2365.  
  2366. 5.5.1 Building an FINSTALL.DIR File
  2367.  
  2368. The installer will build an FINSTALL.DIR file for the fonts listed in the
  2369. Installed list box of the installer dialog box. The developer should hold
  2370. down the CTRL and SHIFT keys while choosing the Exit button. The installer
  2371. prompts the user for the name and path of the FINSTALL.DIR file. If a file
  2372. by the same name already exists, the installer will prompt to replace the
  2373. file.
  2374.  
  2375. This feature has several uses:
  2376.  
  2377. o   To preserve the soft font and cartridge entries when the user wants to
  2378.     reinstall Windows.
  2379.  
  2380. o   To expedite moving fonts to another computer.
  2381.  
  2382. o   To use as a starter file for developers or power users who want to set
  2383.     up a distribution disk of fonts.
  2384.  
  2385. This feature is primarily intended to be used by technical support
  2386. specialists who are directing users to perform certain operations. A user
  2387. may be advised to erase part or all of the contents of his or her machine
  2388. and start over. This feature is very useful in preventing the loss of
  2389. soft-font information.
  2390.  
  2391.  
  2392. 5.5.2 Adding Fonts
  2393.  
  2394. Developers can gain access to an advanced Add Fonts dialog box by holding
  2395. down the CTRL and SHIFT keys when choosing the Add Fonts button. This
  2396. dialog box gives developers the following options:
  2397.  
  2398. o   The ability to specify the path from which the installer should read
  2399.     fonts.
  2400.  
  2401. o   The ability to rename the FINSTALL.DIR file.
  2402.  
  2403. o   The ability to indicate if an error file should be written and specify
  2404.     its name.
  2405.  
  2406. The first option is available to users through the normal Add fonts dialog
  2407. box. The other two options are intended to be used by font vendors or
  2408. advanced users setting up FINSTALL.DIR files for distribution.
  2409.  
  2410. Before parsing the FINSTALL.DIR file, the installer will report the screen
  2411. aspect ratio. The installer will classify the screen type as either
  2412. EGA(4:3) or VGA(1:1). It uses the same algorithm to classify the screen
  2413. fonts listed in the FINSTALL.DIR file. The fonts that match the category in
  2414. which the screen was classified would be loaded by the installer.
  2415.  
  2416. The formula the installer uses to classify screens is as follows:
  2417.  
  2418. o   Compute the screen width in lines-per-inch (horizontal resolution
  2419.     divided by horizontal size converted from millimeters to inches):
  2420.  
  2421.     width = (GetDeviceCaps(HORZ_RES) * 25) / (GetDeviceCaps(HORZSIZE))
  2422.  
  2423. o   Compute the screen height in lines-per-inch (vertical resolution
  2424.     divided by vertical size converted from millimeters to inches):
  2425.  
  2426.     height = (GetDeviceCaps(VERT_RES) * 25) / (GetDeviceCaps(VERTSIZE))
  2427.  
  2428. o   Take the inverse ratio of width to height:
  2429.  
  2430.     ratio = (height * 10000) / width
  2431.  
  2432. o   Categorize the screen type based upon the ratio:
  2433.  
  2434.     6250 to 9374     EGA (4:3)
  2435.  
  2436.     9375 and above   VGA (1:1)
  2437.  
  2438. It is highly recommended that font vendors use the advanced Add Fonts
  2439. dialog box to verify that there are no syntax errors in the FINSTALL.DIR
  2440. file. If the installer finds errors in the FINSTALL.DIR file, it will write
  2441. error messages in the FINSTALL.ERR file. The messages will be of the form:
  2442.  
  2443.     line line-number, near character character position : error message
  2444. The installer also displays a message indicating that errors were found and
  2445. written to the file.
  2446.  
  2447.  
  2448. 5.6 Printer Font Installer Scenarios
  2449.  
  2450. This section presents some sample uses of the Printer Font Installer. It
  2451. starts with recommendations for selecting printer and screen fonts, then
  2452. presents some cookbook approaches to performing certain tasks with the
  2453. Printer Font Installer.
  2454.  
  2455.  
  2456. 5.6.1 Selecting Printer Fonts
  2457.  
  2458. Fonts take up disk space and printer memory. Planning which fonts are
  2459. needed and installing only those fonts can save disk space. Selecting fonts
  2460. is a subjective process. It requires making tradeoffs between document
  2461. design and computer memory, disk space, printer memory, and printing speed.
  2462.  
  2463. The recommendations presented in this section are based upon experience
  2464. gained from working with Windows and soft fonts. The intent of these
  2465. recommendations is to help you optimize the amount of disk space and
  2466. printer memory used by soft fonts. Some of the recommendations indicate
  2467. that you should not load certain variations of fonts; you may want to
  2468. experiment to determine if the additional expense in print time and disk
  2469. space is worth including these fonts.
  2470.  
  2471. It is recommended that you load the typographic range of point sizes and
  2472. limiting documents to using these sizes. The typographic range is as
  2473. follows:
  2474.  
  2475.     6, 7, 8, 9, 10, 11, 12, 14, 18, 24, 30, 48, 60, 72
  2476. Better yet, if you know exactly which sizes you normally use in a document,
  2477. load only those sizes. For example, a document may use only the following
  2478. point sizes of MS Sans Serif:
  2479.  
  2480.     11 point for body text
  2481.     9 point for running headers, running footers, and footnotes
  2482.     14, 24, and 30 point bold for subheads and headlines
  2483. By loading only these sizes, you reduce the number of fonts taking up disk
  2484. space.
  2485.  
  2486. It is recommended that you generate normal and italic for all point sizes,
  2487. and bold for point sizes equal to and above 14 points. The driver for
  2488. Hewlett-Packard printers that use PCL has the capability to simulate bold
  2489. text. It will not look the same as the true bold face, so you may want to
  2490. experiment first (for example, print a document with bold type but with no
  2491. bold loaded, and then load the bold and reprint the document). Normally,
  2492. however, the driver-simulated bold is adequate for the small point sizes.
  2493.  
  2494. To save on even more space, we recommend that you load bold only for the
  2495. larger sizes (that is, 24 points and above). The assumption is that you
  2496. will only use bold sizes for headlines.
  2497.  
  2498. Avoid loading bold italic for a font. Bold italic consumes disk space and
  2499. printer memory and, because bold italic is rarely used, it does not warrant
  2500. the space it requires. As an alternative, the driver will simulate bold
  2501. italic by synthetically bolding the italic face.
  2502.  
  2503. Character sets can make a big difference in the amount of disk space and
  2504. printer memory used by a font. If the document never uses accented
  2505. characters or special symbols like the bullet and copyright, it is
  2506. recommended that you use the USASCII character set. If the document
  2507. requires these characters, use the Windows ANSI, ECMA-94, or Roman-8
  2508. character sets (listed in order of preference, depending upon which sets
  2509. you have access to).
  2510.  
  2511. Fonts in the USASCII character set contain a little more than half the
  2512. number of characters contained in the Windows ANSI, ECMA-94, and Roman-8
  2513. character sets. By selecting USASCII, you effectively half the amount of
  2514. disk space and printer memory used by the font. We recommend using, in
  2515. order of preference, Windows ANSI, ECMA-94, or Roman-8 for point sizes
  2516. below 14 points and USASCII for point sizes 14 points and above.
  2517.  
  2518.  
  2519. 5.6.2 Selecting Screen Fonts
  2520.  
  2521. Selecting screen fonts is considerably different from selecting printer
  2522. fonts. The selection of screen font sizes should not be based upon the
  2523. selected printer font sizes. It does not make sense to build one
  2524. corresponding screen font for every printer font for the following reasons:
  2525.  
  2526. o   Screen fonts in Windows are sized and modified by the screen driver.
  2527.     The screen driver can derive normal, bold, italic, and bold italic
  2528.     variations from one screen font.
  2529.  
  2530. o   Screen fonts are selected by way of a generic selection process
  2531.     controlled by the application and the screen driver. One cannot assume
  2532.     that a screen font specifically intended for a printer font will be
  2533.     used to display that font.
  2534.  
  2535. o   Some applications allow the user to see the font at different views
  2536.     (for example, fit in window, 100 percent, and 200 percent). A screen
  2537.     font should be provided for each view.
  2538.  
  2539. o   Most important, screen fonts take dynamic memory away from
  2540.     applications, thus slowing the overall performance of Windows.
  2541.  
  2542. Poorly selected screen fonts can both slow the performance of the system
  2543. and produce a confusing screen display.
  2544.  
  2545. Regardless of the printer font sizes and variations selected, it is
  2546. recommended that you load a shortened typographic range of screen fonts:
  2547.  
  2548.     8, 9, 10, 12, 14, 18, 24
  2549. Load these fonts in normal face only; the screen driver can simulate bold,
  2550. italic, and bold italic. There is no need to double, triple, or quadruple
  2551. the memory used by screen fonts to get these special fonts.
  2552.  
  2553. Do not load screen fonts for printer fonts that are like Courier. Windows
  2554. already provides those screen fonts. Additional screen fonts would use up
  2555. memory without additional visual benefits.
  2556.  
  2557. If you generate one printer font, you should generate the entire
  2558. recommended range. Applications typically offer more than one view of the
  2559. page, so the screen driver will need the different sizes to display the
  2560. font in each view.
  2561.  
  2562. If you feel you want the typographic quality of prebuilt bold and italic
  2563. screen fonts, then you should experiment to see if these fonts look better
  2564. than fonts synthesized by the screen driver. Display a page of text with
  2565. only the normal face loaded, then display it with the normal, bold, and
  2566. italic faces loaded.
  2567.  
  2568. Never load a bold or italic screen font without a corresponding normal face
  2569. font. Without the normal face, the screen driver will always use the bold
  2570. or italic face, producing a confusing screen display.
  2571.  
  2572. For example, suppose you decide to create a document that uses a 24-point
  2573. italic font. You then load one printer and one screen font as 24-point
  2574. italic. Thereafter, every time the screen driver determines it needs a
  2575. 24-point screen font that is similar to the font that you installed, it
  2576. will use the 24-point italic face. Regardless of the variation you want
  2577. (that is, normal, bold, or italic), the font will display in italic.
  2578.  
  2579. As you add more fonts to your computer, the situation will become more
  2580. confusing. To continue the example, suppose you decide to add the same
  2581. printer and screen font as 48-point normal.
  2582.  
  2583. When the application displays the 48-point font at 100 percent view on the
  2584. screen, the font will display as 48-point normal (that is, the correct
  2585. behavior). At 50 percent view, the font will display as 24-point italic
  2586. (because that is the only font available). When switching views, therefore,
  2587. the font changes from normal to italic.
  2588.  
  2589. You can avoid this problem simply by not loading anything other than the
  2590. normal face of the screen font. Normally, the difference between the
  2591. synthesized font and the true font is barely noticeable, if noticeable at
  2592. all. If you must load the italic or bold variations, then you must also
  2593. load the normal variation in the same size.
  2594.  
  2595.  
  2596. 5.6.3 Recovering Soft Fonts from a WIN.INI Change
  2597.  
  2598. Sometimes you need to remove the contents of your WINDOWS directory and
  2599. reinstall Windows. In the process of doing this, you could lose all the
  2600. soft font information. To prevent losing data:
  2601.  
  2602. 1.  Build an FINSTALL.DIR file.
  2603.  
  2604.     Using Windows, select the Printers icon from Control Panel, select the
  2605.     HP LaserJet printer that uses PCL, and choose the Setup command.
  2606.  
  2607.     Once inside the driver-specific dialog box, choose the Fonts button to
  2608.     call the Printer Font Installer. The fonts you plan to save should be
  2609.     listed in the left list box. Hold down the CTRL and SHIFT keys while
  2610.     choosing the Exit button. The installer prompts for a filename and
  2611.     path. Choose the OK button to accept the name of the FINSTALL.DIR file.
  2612.     Then, exit Windows.
  2613.  
  2614. 2.  Reinstall Windows.
  2615.  
  2616.     Perform whatever steps are necessary to reinstall Windows (that is,
  2617.     remove everything in the WINDOWS directory and run the Windows Setup
  2618.     program).
  2619.  
  2620. 3.  Install from the directory to itself to get the soft fonts listed.
  2621.  
  2622.     Run the Printer Font Installer on the new computer through the Control
  2623.     Panel's Printers icon. Select the HP LaserJet printer that uses PCL,
  2624.     and then choose the Setup command.
  2625.  
  2626.     From the driver-specific dialog box, choose the Fonts button to call
  2627.     the installer. If the Fonts button is not highlighted, then you need to
  2628.     select a printer that supports soft fonts (lower-left list box in the
  2629.     driver-specific dialog box). Choose Add fonts and specify \PCLFONTS as
  2630.     the source for copying fonts. If your fonts are stored in another
  2631.     directory (such as FONTS or PCLPFM), then specify that directory.
  2632.  
  2633.     Hold down the CTRL and SHIFT keys while selecting all the fonts in the
  2634.     right list box. Choose the Add button between the two list boxes. The
  2635.     installer prompts for a target directory. This must be equivalent to
  2636.     the directory from which you are installing the fonts. If you are
  2637.     installing from \PCLFONTS, then choose the OK button to accept
  2638.     \PCLFONTS as the target directory. Otherwise, change the name to that
  2639.     of the directory that contains the soft fonts (such as FONTS or PCLPFM).
  2640.  
  2641.     The installer then shuffles the fonts very quickly from the right list
  2642.     box to the left list box. It does not copy any fonts; it simply updates
  2643.     the WIN.INI file. If this does not happen quickly, then you probably
  2644.     did not build an FINSTALL.DIR file as described in Step 1, or did not
  2645.     install fonts from and to the same directory.
  2646.  
  2647.  
  2648. 5.6.4 A Quick Method for Moving Fonts to Another Computer
  2649.  
  2650. The purpose of this section is to describe how to move fonts from one
  2651. computer to another. It is not intended for distributing fonts to several
  2652. users. This description is not intended to encourage illegal copying of
  2653. fonts. We assume that you are removing fonts from one computer and adding
  2654. them to another.
  2655.  
  2656. The steps are as follows:
  2657.  
  2658. 1.  Build an FINSTALL.DIR file.
  2659.  
  2660.     Using Windows, select the Printers icon from Control Panel, select the
  2661.     PCL/HP LaserJet printer, and choose the Setup command.
  2662.  
  2663.     Once inside the driver-specific dialog box, choose the Fonts button to
  2664.     call the Printer Font Installer. The fonts you plan to save should be
  2665.     listed in the left list box. Hold down the CTRL and SHIFT keys while
  2666.     choosing the Exit button. The installer prompts for a filename and
  2667.     path. Choose OK to accept the name of the FINSTALL.DIR file. Then, quit
  2668.     Windows.
  2669.  
  2670. 2.  Use the MS-DOS xcopy command to copy files to a floppy disk, by
  2671.     following these instructions:
  2672.  
  2673.     To change to the directory containing the soft fonts, type:
  2674.  
  2675.         cd \PCLFONTS
  2676.     To make sure that all the files in the directory are not marked for
  2677.     archive, type:
  2678.  
  2679.         attrib -a *.*
  2680.     To copy files to the first disk, type:
  2681.  
  2682.         xcopy *.* a: /m
  2683.     If MS-DOS reports an insufficient disk space error, repeat the xcopy
  2684.     command. The /m option on the xcopy command instructs MS-DOS to mark
  2685.     the files it has copied to disk, so when you repeat the command it does
  2686.     not recopy the files that are already on disk.
  2687.  
  2688.     Repeat the xcopy command until all the files are on the disks.
  2689.  
  2690. 3.  Copy the files from the floppy disks to the new machine, by following
  2691.     these instructions:
  2692.  
  2693.     On the new machine, to make a directory for the fonts, type:
  2694.  
  2695.         cd \
  2696.         mkdir \PCLFONTS
  2697.         cd \PCLFONTS
  2698.     To copy the fonts from the floppy disk into the new directory, type:
  2699.  
  2700.         copy a:*.*
  2701.     Repeat this step for every floppy disk.
  2702.  
  2703. 4.  Install from the directory to itself to get the soft fonts listed.
  2704.  
  2705.     Run the Printer Font Installer on the new machine through Control
  2706.     Panel's Printers icon. Select the HP LaserJet printer that uses PCL,
  2707.     and then choose the Setup command.
  2708.  
  2709.     From the driver-specific dialog box, choose the Fonts button to start
  2710.     the installer. Choose Add fonts and specify \PCLFONTS as the source for
  2711.     copying fonts. The installer should list all the fonts you just copied
  2712.     into the \PCLFONTS directory.
  2713.  
  2714.     Hold down the CTRL and SHIFT keys while selecting all the fonts in the
  2715.     right list box. Choose the Add button between the two list boxes. The
  2716.     installer will prompt for a target directory. This must be the same
  2717.     directory from which you are installing the fonts. If you are
  2718.     installing from \PCLFONTS, as these instructions indicate, then choose
  2719.     OK to accept \PCLFONTS as the target directory.
  2720.  
  2721.     The installer then shuffles the fonts very quickly from the right list
  2722.     box to the left list box. It does not copy any fonts; it simply updates
  2723.     the WIN.INI file. If this does not happen quickly, then you probably
  2724.     did not build an FINSTALL.DIR file as described in Step 1, or did not
  2725.     install fonts from and to the same directory.
  2726.  
  2727. The fonts will be moved to the new computer. This procedure is probably the
  2728. fastest and simplest way to move fonts from one computer to the other.
  2729. However, we do not recommend it as a general method of distributing fonts.
  2730. The installer has a more elegant and less error-prone way of loading fonts
  2731. from floppy disks as described in the next section.
  2732.  
  2733.  
  2734. 5.6.5 Building a Floppy Disk Set of Fonts
  2735.  
  2736. This section describes how to set up a floppy disk set of fonts for
  2737. distribution. This procedure is useful, for example, if a company chooses
  2738. to use a range of fonts available from a font-generation utility. One
  2739. person could generate the fonts and create a disk set of fonts for internal
  2740. distribution. Then, all the other users could quickly and easily install
  2741. the pregenerated fonts without having to learn how to use the
  2742. font-generation utility.
  2743.  
  2744. To carry out the following procedure, you must know how to use MS-DOS and a
  2745. text editor.
  2746.  
  2747. The steps are as follows:
  2748.  
  2749. 1.  Install or generate the soft fonts.
  2750.  
  2751.     Load the fonts onto your computer. You should build a set of screen
  2752.     fonts for each type of display that may be used. Generally, this would
  2753.     be an EGA or a VGA.
  2754.  
  2755.     When you make changes to the FINSTALL.DIR file (see Step 4), you can
  2756.     instruct the installer to load different screen fonts depending upon
  2757.     the aspect ratio of the computer receiving the fonts.
  2758.  
  2759. 2.  Build an FINSTALL.DIR file.
  2760.  
  2761.     Using Windows, select the Printers icon from Control Panel, select the
  2762.     HP LaserJet printer that uses PCL, and then choose the Setup command.
  2763.  
  2764.     Once inside the driver-specific dialog box, choose the Fonts button to
  2765.     start the Printer Font Installer. The fonts you plan to save should be
  2766.     listed in the left list box. Hold down the CTRL and SHIFT keys while
  2767.     choosing the Exit button. The installer prompts for a filename and
  2768.     path. Choose OK to accept the name of the FINSTALL.DIR file. Then, quit
  2769.     Windows.
  2770.  
  2771. 3.  Arrange the font files, PFM files, PCM files, screen-font files, and
  2772.     FINSTALL.DIR file onto disks.
  2773.  
  2774.     If all the files fit on one disk, this is an easy task. If they do not
  2775.     and the number of fonts is great, this may be a major task. For more
  2776.     information about arranging the files, see the section at the end of
  2777.     this procedure list.
  2778.  
  2779. 4.  Edit the FINSTALL.DIR file to add logical drives.
  2780.  
  2781.     If the files require more than one disk, edit the FINSTALL.DIR file and
  2782.     add logical drives so the installer will know where all the files are.
  2783.     With logical drives properly set up, the installer will prompt the user
  2784.     to switch disks when necessary.
  2785.  
  2786.     If you loaded screen fonts, add entries in the FINSTALL.DIR file for
  2787.     screen fonts as well. Place the screen fonts in the appropriate FAMILY
  2788.     block for which the screen fonts were made.
  2789.  
  2790. 5.  Test the font-installation process thoroughly.
  2791.  
  2792.     Make sure that all the fonts are correctly loaded. If you have screen
  2793.     fonts for different aspect ratios, test loading fonts on machines with
  2794.     different screen displays.
  2795.  
  2796.     Use the advanced Add fonts button to check the syntax of your
  2797.     FINSTALL.DIR file, and verify your screen display type.
  2798.  
  2799. Arranging font files onto disks can be an extremely tedious task,
  2800. especially if you have to set up disks for 360K, 720K (3.5 inch), and 1.2M
  2801. builds and need to conserve disk space.
  2802.  
  2803. Here are some recommendations:
  2804.  
  2805. o   Keep the screen font files for one FAMILY together on the same disk,
  2806.     and make sure the lowest point size font is also on that disk.
  2807.  
  2808. o   Keep each PFM file on the same disk as its corresponding printer-font
  2809.     file.
  2810.  
  2811. o   Conserve disk space by putting the largest fonts on the disk with the
  2812.     smallest fonts.
  2813.  
  2814. o   If you are building the set for different disk densities, build the
  2815.     360K set first, then put the files from two disks onto each 720K disk,
  2816.     and the files from three disks onto each 1.2M disk.
  2817.  
  2818. The easiest way to build the disk set is to place files on the disks in the
  2819. exact order in which they appear in the FINSTALL.DIR file. That is, the
  2820. FINSTALL.DIR file goes on first, followed by the screen fonts for the first
  2821. family listed, followed by the .PFM and font files for that family. Make
  2822. sure that all the screen-font files for one family go on the same disk, and
  2823. that at least one printer font (the first one listed in the FAMILY
  2824. statement) with its PFM file also goes on that disk.
  2825.  
  2826. Once the disk set is built and working, reorganize the files to optimize
  2827. for disk space usage.
  2828.  
  2829.  
  2830. 5.6.6 Setting Up Fonts on a Network
  2831.  
  2832. This section describes how a network administrator can set up fonts to use
  2833. on a network. To carry out this procedure, you must know how to use MS-DOS
  2834. and a text editor.
  2835.  
  2836. To set up fonts for use on a network, follow these steps:
  2837.  
  2838. 1.  Install or generate the soft fonts.
  2839.  
  2840.     Load the fonts onto your computer. You should build a set of screen
  2841.     fonts for each type of display that may be used. Generally, this would
  2842.     be an EGA or a VGA.
  2843.  
  2844.     When you make changes to the FINSTALL.DIR file (see Step 5), you can
  2845.     instruct the installer to load different screen fonts depending upon
  2846.     the aspect ratio of the machine receiving the fonts.
  2847.  
  2848. 2.  Select permanent fonts.
  2849.  
  2850.     To use permanently downloaded soft fonts, start the Printer Font
  2851.     Installer (described in the next step) and select the fonts you want
  2852.     permanently downloaded to the printer. When you exit the installer, it
  2853.     will prompt you for the download options. Make sure Download at startup
  2854.     is checked.
  2855.  
  2856. 3.  Build an FINSTALL.DIR file.
  2857.  
  2858.     Using Windows, select the Printers icon from Control Panel, select the
  2859.     HP LaserJet printer that uses PCL, and choose the Setup command.
  2860.  
  2861.     Once inside the driver-specific dialog box, choose the Fonts button to
  2862.     start the Printer Font Installer. The fonts you plan to save should be
  2863.     listed in the left list box. Hold down the CTRL and SHIFT keys while
  2864.     choosing the Exit button. The installer prompts for a filename and
  2865.     path. Choose OK to accept the name of the FINSTALL.DIR file. Then, quit
  2866.     Windows.
  2867.  
  2868. 4.  If you are not working from the file server, copy the fonts to the file
  2869.     server.
  2870.  
  2871.     If you created and installed fonts from the network server, you can
  2872.     skip this step.
  2873.  
  2874.     Set up a directory on the file server for the fonts and copy all the
  2875.     files to it. Use MS-DOS commands to do this. If you set up permanent
  2876.     fonts, move the files created by the installer from your computer to
  2877.     the network computer, and edit the AUTOEXEC.BAT file on the network to
  2878.     transfer the command line starting the download batch file.
  2879.  
  2880. 5.  Edit the FINSTALL.DIR file to add screen fonts.
  2881.  
  2882.     If you generated screen fonts, edit the FINSTALL.DIR file to add
  2883.     references to the fonts.
  2884.  
  2885.     You do not need to add logical drives to the FINSTALL.DIR file if all
  2886.     the font files and PFM files reside in one directory.
  2887.  
  2888. 6.  Test the font installation process thoroughly.
  2889.  
  2890.     Make sure that all the fonts are correctly loaded. If you have screen
  2891.     fonts for different aspect ratios, test loading fonts on computers with
  2892.     different screen displays.
  2893.  
  2894.     Use the advanced Add fonts button to check the syntax of your
  2895.     FINSTALL.DIR file, and verify your screen display type.
  2896.  
  2897. 7.  Announce the availability of soft fonts to network users.
  2898.  
  2899.     Instruct your users that the fonts are available. They can load the
  2900.     fonts by running the Printer Font Installer and choosing the Add fonts
  2901.     button. They should indicate the network drive and path to the
  2902.     directory containing the soft fonts. Installing the fonts this way will
  2903.     be much faster than loading from floppy disks.
  2904.  
  2905.     If you set up permanent soft fonts, then your instructions must list
  2906.     those fonts and their ID numbers for the users. Instruct the users to
  2907.     choose the Edit button and edit each of the permanent fonts, verifying
  2908.     the ID numbers. They must change the ID numbers on any fonts that do
  2909.     not match your list.
  2910.  
  2911. Make sure that all the users have assigned the correct IDs to their
  2912. permanent fonts. This is not as difficult as it seems. There usually are
  2913. only a few permanent fonts, and the installer resolves ID conflicts. If the
  2914. user attempts to assign an ID to a font that is used by another font, the
  2915. installer will ask the user if the other font should be assigned a new ID.
  2916. The installer will select the first available ID number when assigning a
  2917. new ID.
  2918.  
  2919.  
  2920. 5.6.7 Setting Up PFM Files for Resident and Cartridge Fonts
  2921.  
  2922. It is possible to build special PFM files for printer-resident and
  2923. cartridge fonts. These fonts should be set up as permanently downloaded
  2924. fonts in the WIN.INI file or collected into a cartridge PCM file. The
  2925. special PFM files contain the escape sequences that the driver will send to
  2926. the printer to use the fonts. Font or printer vendors will most likely
  2927. build the PFM and PCM files.
  2928.  
  2929. In short, to set up cartridge and printer-resident fonts, the developer
  2930. should do the following:
  2931.  
  2932. 1.  Build special PFM files.
  2933.  
  2934. 2.  If appropriate, combine PFMs into a PCM using the PFM Editor.
  2935.  
  2936. 3.  Make a special FINSTALL.DIR file for loading PFM-only fonts or PCM
  2937.     files.
  2938.  
  2939. In addition to the structures described for the PFM files, the driver has a
  2940. driver-specific data structure that must be added to the file. The
  2941. PFMEXTENSION structure contains a dfDriverInfo member. This member is a
  2942. file offset to the driver-specific structure. For the PCL driver, the
  2943. driver-specific structure is the DRIVERINFO structure.
  2944.  
  2945. The value of the members in the DRIVERINFO structure should be filled in as
  2946. follows.
  2947.  
  2948. Member              Value
  2949. ---------------------------------------------------------------------------
  2950.  
  2951. epEscape            An offset from the top of the file to the escape string
  2952.                     that the driver should send to the printer to call the
  2953.                     font.
  2954.  
  2955. epMemUsage          An approximation of the printer memory used by the font.
  2956.  
  2957. epSize              Size of (DRIVERINFO).
  2958.  
  2959. epVersion           1.
  2960.  
  2961. firstchar of xtbl   (BYTE)0.
  2962.  
  2963. lastchar of xtbl    (BYTE)0.
  2964.  
  2965. len of xtbl         0.
  2966.  
  2967. offset of xtbl      (long)0.
  2968.  
  2969. symbolSet of xtbl   epsymGENERIC7 for 7-bit fonts and epsymGENERIC8 for
  2970.                     8-bit fonts.
  2971.  
  2972. In addition, the escape string for calling the fonts must be written to the
  2973. PFM file. The driver will use the escape string pointed to by epEscape to
  2974. select the font. Once the PFM and PCM files are built, you must make an
  2975. FINSTALL.DIR file.
  2976.  
  2977. In PFM files, the absence of the downloadable font file is indicated by two
  2978. commas in the font string, as in the following example:
  2979.  
  2980.     "Acme Ace 12pt"=PL,  ,  CPY_ACE.PFM
  2981. The installer loads these fonts as permanently downloadable soft fonts.
  2982. This has one side effect. When the user quits the installer, it will prompt
  2983. for download options. Because the installer thinks the fonts are permanent
  2984. soft fonts, it will try to download them to the printer. However, it will
  2985. not find the permanent font files because they do not exist. Therefore, the
  2986. installer will simply ignore the files and not make a download batch file
  2987. or open a print job. However, if these fonts are mixed in with other real
  2988. permanent soft fonts, then the installer will correctly download those
  2989. fonts.
  2990.  
  2991. If the intended printer is a standard HP LaserJet, the driver will not load
  2992. soft font PFM files. The driver will not load the PFM files when the
  2993. intended printer cannot handle soft fonts. However, the user may instruct
  2994. the driver to load cartridge font (PCM) information to gain access to the
  2995. cartridge font information. To override the soft font restrictions, you can
  2996. place the following setting in the driver-specific section of the WIN.INI
  2997. file:
  2998.  
  2999.     options=7
  3000. This setting instructs the driver to load soft font information regardless
  3001. of the printer's abilities. However, this is not recommended.
  3002.  
  3003.  
  3004. 5.7 Directory File Reference
  3005.  
  3006. The following is an alphabetical listing of the printer font directory file
  3007. statements.
  3008.  
  3009. CARTRIDGE
  3010.  
  3011.     CARTRIDGE {
  3012.         aspect-ratio = "description", screen-font-file
  3013.         "cartridge-title" = PCM-file
  3014.         .
  3015.         .
  3016.         .
  3017.     }
  3018. The CARTRIDGE statement defines the PCM file and screen-font files
  3019. associated with a given cartridge. The statement provides one or more sets
  3020. of aspect-ratio and cartridge-title parameters defining these associations.
  3021.  
  3022.  
  3023. Parameters
  3024.  
  3025.    aspect-ratio
  3026.    Specifies the width and height of the screen font in lines-per-inch.
  3027.    This parameter has the following form:
  3028.  
  3029.                          width:height
  3030.    More than one aspect ratio may be listed by separating each with a
  3031.    comma.
  3032.  
  3033.    description
  3034.    Specifies a string identifying the screen-font face and other
  3035.    information, such as the device for which the font was designed. This
  3036.    string should be identical to the text that immediately follows the
  3037.    colon (:) in the DESCRIPTION statement of the font resource file.
  3038.    Control Panel also uses the DESCRIPTION statement to create an entry for
  3039.    the font under the [Fonts] section in the WIN.INI file. The parameter
  3040.    must be enclosed in double quotation marks.
  3041.  
  3042.    screen-font-file
  3043.    Specifies the name and location of the screen-font file. This parameter
  3044.    should consist of a logical disk identifier (as given in a preceding
  3045.    DRIVE statement) and the filename of the screen-font file. If the file
  3046.    is not in the root directory on the given disk, the full path of the
  3047.    file should be used.
  3048.  
  3049.    cartridge-title
  3050.    Specifies the name of the cartridge displayed in the Printer Font
  3051.    Installer's list box. This name should, but does not need to, match the
  3052.    title in the PCM file.
  3053.  
  3054.    PCM-file
  3055.    Specifies the name and location of the PCM file for the cartridge. This
  3056.    parameter should consist of a logical disk identifier (as given in a
  3057.    preceding DRIVE statement) and the filename of the screen font file. If
  3058.    the file is not in the root directory on the given disk, the full path
  3059.    of the file should be used.
  3060.  
  3061.  
  3062.  
  3063. DRIVE
  3064.  
  3065.     DRIVE id[:] = label-file [, label-descriptor ]
  3066. The DRIVE statement defines the logical name for a given distribution disk.
  3067.  
  3068.  
  3069. Parameters
  3070.  
  3071.    id
  3072.    Specifies the logical name for the given disk. Subsequent statements in
  3073.    the FINSTALL.DIR file use the id with filenames instead of physical
  3074.    drive identifiers.
  3075.  
  3076.    label-file
  3077.    Specifies the name of the label file. The Printer Font Installer uses
  3078.    this file to determine whether the current disk in the drive is the
  3079.    correct disk. The label file must have the .LBL file extension. All
  3080.    label files in a set of distribution disks must be unique.
  3081.  
  3082.    If Printer Font Installer checks for a label file and does not find it,
  3083.    the installer prompts the user to insert the correct disk. The installer
  3084.    repeats the prompt until the user inserts the correct disk.
  3085.  
  3086.    label-descriptor
  3087.    Specifies a general description for the disk. The Printer Font Installer
  3088.    uses the description when it prompts for the disk. This parameter (if
  3089.    given) must be enclosed in double quotation marks. If the parameter is
  3090.    not given, the Printer Font Installer uses the name of the label file as
  3091.    the descriptor when prompting for a disk.
  3092.  
  3093.  
  3094. Examples
  3095.  
  3096.     DRIVE disk1: = disk1.lbl, "Font Library disk #1"
  3097. This examples sets disk1 to be the logical name for a disk. The Printer
  3098. Font Installer checks for the label file, DISK1.LBL, whenever statements in
  3099. the FINSTALL.DIR file use the fontlib1 and a driver identifier.
  3100.  
  3101.  
  3102.  
  3103. FAMILY
  3104.  
  3105.     FAMILY [ family-name ] {
  3106.         aspect-ratio = description, screen-font-file
  3107.         font-description = orient, [ download-file ] [, PFM-file ]
  3108.         .
  3109.         .
  3110.         .
  3111.     }
  3112. The FAMILY statement defines the screen-font files associated with one or
  3113. more downloadable files. The statement names a font family and provides one
  3114. or more sets of aspect-ratio and font-description parameters defining these
  3115. associations.
  3116.  
  3117.  
  3118. Parameters
  3119.  
  3120.    family-name
  3121.    Specifies a general description of the font family. If this parameter is
  3122.    given, it must be enclosed in double quotation marks.
  3123.  
  3124.    aspect-ratio
  3125.    Specifies the width and height of the screen font in lines-per-inch.
  3126.    This parameter has the following form:
  3127.  
  3128.                          width:height
  3129.    More than one aspect ratio may be listed by separating each with a
  3130.    comma.
  3131.  
  3132.    description
  3133.    Specifies a string identifying the font and other information, such as
  3134.    the device for which the font was designed. This string should be
  3135.    identical to the text that immediately follows the colon (:) in the
  3136.    DESCRIPTION statement of the font-resource file. Note that Control Panel
  3137.    also uses the DESCRIPTION statement to create an entry for the font
  3138.    under the [Fonts] section in the WIN.INI file. The parameter must be
  3139.    enclosed in double quotation marks.
  3140.  
  3141.    screen-font-file
  3142.    Specifies the name and location of the screen-font file. This parameter
  3143.    should consist of a logical disk identifier (as given in a preceding
  3144.    DRIVE statement) and the filename of the screen-font file. If the file
  3145.    is not in the root directory on the given disk, the full path of the
  3146.    file should be used.
  3147.  
  3148.    font-description
  3149.    Specifies the name displayed in the Printer Font Installer's list box.
  3150.    This parameter should have the following form:
  3151.  
  3152.                          face-name point-size [bold] [italic]
  3153.    The face-name should be the exact name for the font. The point-size
  3154.    should be the font's point size in decimal, immediately followed by the
  3155.    word points or the abbreviation pt. The words bold and italic should be
  3156.    used only if the font has those attributes.
  3157.  
  3158.    The parameter must be enclosed in double quotation marks.
  3159.  
  3160.    orient
  3161.    Specifies the font's orientation (portrait or landscape). This parameter
  3162.    is either P (or p) for portrait orientation or L (or l) for landscape
  3163.    orientation. PL or LP may be used to indicate either orientation.
  3164.  
  3165.    download-file
  3166.    Specifies the name and location of the downloadable font file. This
  3167.    parameter should consist of a logical disk identifier (as given in a
  3168.    preceding DRIVE statement) and the filename of the downloadable font
  3169.    file. If the file is not in the root directory on the given disk, the
  3170.    full path of the file should be used.
  3171.  
  3172.    Although the download-file parameter is optional, the commas preceding
  3173.    and following it are not. If this parameter is omitted, the PFM-file
  3174.    parameter must be present.
  3175.  
  3176.    PFM-file
  3177.    Specifies the name and location of the printer font metrics file. This
  3178.    parameter should consist of a logical disk identifier (as given in a
  3179.    preceding DRIVE statement) and the filename of the downloadable font
  3180.    file. If the file is not in the root directory on the given disk, the
  3181.    full path of the file should be used.
  3182.  
  3183.    The PFM-file parameter is optional. Although the Printer Font Installer
  3184.    will generate a PFM file if the parameter is omitted, this approach is
  3185.    discouraged because PFM files generated this way may be less accurate
  3186.    than PFM files created by the font manufacturer.
  3187.  
  3188.  
  3189. Comments
  3190.  
  3191. If the installer fails to find a font having the same resolution as the
  3192. display device but finds fonts with matching aspect ratios, the installer
  3193. installs the font whose resolution is less than or equal to the desired
  3194. resolution. (If there is no resolution less than or equal to the desired
  3195. resolution, then it chooses the lowest resolution.) If there is no screen
  3196. font with a matching aspect ratio, the installer installs no screen fonts.
  3197.  
  3198.  
  3199. Examples
  3200.  
  3201.     FAMILY [ "" ] {
  3202.     96:96 = "Courier 8,10,12", disk1:cour03.fon
  3203.     "Courier 8pt bold italic"=LP,disk1:cour08bi.usp,disk1:cour08bi.pfm
  3204.     }
  3205. Chapter 6  PostScript Printer Driver
  3206.  
  3207. The Microsoft Windows PostScript printer driver supports a wide variety of
  3208. PostScript printers and fonts. This chapter provides a brief overview of
  3209. the features for the driver and in particular those features new for
  3210. Windows 3.1.
  3211.  
  3212.  
  3213. 6.1 External Printer Installation
  3214.  
  3215. The PostScript driver can support printers that are not listed in its
  3216. default list of the supported printers. Such external printers must have
  3217. accompanying Windows printer description (WPD) files that provide the
  3218. information the PostScript driver needs to access the printer correctly.
  3219. Typically, printer vendors create the WPD files for and distribute them
  3220. with their printers.
  3221.  
  3222. In Windows 3.1, the PostScript driver uses the same process to install both
  3223. internal and external printers. If a printer vendor supplies a WPD file and
  3224. an OEMSETUP.INF file for the external printer, the user can use the
  3225. Printers dialog box in Control Panel to install the printer. In this case,
  3226. the OEMSETUP.INF file must have a statement having the same form as the
  3227. following example:
  3228.  
  3229.     1:PSCRIPT.DRV,1:NEWPRN.WPD,"New PostScript printer","DEVICESPECIFIC"
  3230. In this example, 1 represents a logical disk and is previously defined in a
  3231. [Disks] section. Control Panel automatically installs both the PostScript
  3232. driver (if necessary) and the WPD file to the SYSTEM directory. The first
  3233. time the printer is used to print a document, the driver scans all the
  3234. installed WPD files, and adds the new external printer to the list of
  3235. installed external printers.
  3236.  
  3237. In Windows 3.1, the maximum number of external printers a user can install
  3238. depends on the available space in WIN.INI. The theoretical limit is 32,000
  3239. printers.
  3240.  
  3241.  
  3242. 6.2 Printer Font Metrics Support
  3243.  
  3244. For printers that have hard disks or resident fonts from some other source,
  3245. external PFM files can be added to the WIN.INI file to make the driver
  3246. aware of these fonts. This is similar to the way soft fonts are installed.
  3247.  
  3248.  
  3249. 6.3 Printer Selection by Model Name
  3250.  
  3251. Windows 3.1 uses model names to identify printers. This means, for example,
  3252. that applications create printer device contexts by passing a model name,
  3253. such as Apple LaserWriter IINT, instead of the generic driver name,
  3254. PostScript.
  3255.  
  3256. This use of model name also affects printer selection. When installing a
  3257. printer, the driver searches the list of installed internal and external
  3258. printers and installed WPD files for the requested model name. This means
  3259. the model name stored in the WPD file must exactly match the model name in
  3260. the initialization file. If the driver is unable to find the requested
  3261. model, it will use the default printer (Apple LaserWriter Plus).
  3262.  
  3263.  
  3264. 6.4 Device Initialization
  3265.  
  3266. The PostScript driver supports the Windows device-initialization functions.
  3267. This means that applications can maintain private, device-independent
  3268. initialization data that is separate from the default configurations set
  3269. using Control Panel. For more information about device-independent
  3270. initialization data, see the ExtDeviceMode and DeviceCapabilities functions
  3271. in the Microsoft Windows Device Driver Adaptation Guide.
  3272.  
  3273.  
  3274. 6.5 Initialization File Entries for PostScript Printers
  3275.  
  3276. The PostScript printer driver uses global and per-port initialization
  3277. sections in the WIN.INI file. These sections specify information about the
  3278. PostScript printer.
  3279.  
  3280.  
  3281. 6.5.1 Global Initialization Section
  3282.  
  3283. The global-initialization section, [Pscript], contains data that is not
  3284. associated with a particular port. In particular, this section defines the
  3285. installed external printers and the corresponding WPD files. The section
  3286. has the following form:
  3287.  
  3288.     [PSCRIPT]
  3289.     External Printers=2
  3290.     printer1=abc_ps
  3291.     printer2=xyz_ps
  3292. The External Printers setting indicates how many external printers there
  3293. are. The printern setting indicates the base filename of a given WPD file
  3294. associated with the external printer.
  3295.  
  3296.  
  3297. 6.5.2 Per-Port Initialization Section
  3298.  
  3299. The per-port initialization section contains data that is specific to each
  3300. port connection. In particular, it defines the printer settings for the
  3301. printer connected to the given port. In Windows 3.1, each printer is
  3302. identified by model name, so the heading for the per-port initialization
  3303. section has the following form:
  3304.  
  3305.     [ModelName,port]
  3306. The ModelName defines the printer (for example, Apple LaserWriter Plus) and
  3307. the port specifies the communication port, such as COM1 or LPT1. The
  3308. following is an example of a per-page initialization section:
  3309.  
  3310.     [Apple LaserWriter Plus,COM1]
  3311.     feed2=1
  3312.     feed15=5
  3313. Windows saves the state of printer connections on a per-port basis. The
  3314. printer number is no longer stored in the section. The number is derived
  3315. from the model name.
  3316.  
  3317.  
  3318. 6.6 Advanced Options Dialog Box
  3319.  
  3320. The Windows 3.1 PostScript driver provides an Advanced Options dialog box
  3321. that gives the user control of most of the driver's advanced features, such
  3322. as duplex printing, font management, TrueType support, and error handling.
  3323. The driver displays the dialog box whenever the user chooses the Options
  3324. button in the driver's Setup dialog box. Descriptions of the various
  3325. advanced options are given in the following sections of this chapter.
  3326.  
  3327.  
  3328. 6.7 Multiple-Resolution Printer Support
  3329.  
  3330. In Windows 3.1, the user can set the resolution of the output by selecting
  3331. the Resolution option in the Advanced Options dialog box. Some printers are
  3332. capable of printing in multiple resolutions and all printers can emulate
  3333. certain resolutions (without changing the physical size of the dots). The
  3334. list of hardware-supported resolutions can be viewed by moving the scroll
  3335. arrow. Items can be selected from the list or an arbitrary value can be
  3336. entered.
  3337.  
  3338. The halftone parameters (angle and frequency) do not update automatically
  3339. when changing the hardware resolution. You must enter the correct values
  3340. manually. Printers that only have one hardware resolution are acceptable.
  3341.  
  3342.  
  3343. 6.8 Duplex Support
  3344.  
  3345. The Windows 3.1 driver supports duplex PostScript printers. If duplex
  3346. printing is enabled (by the printer's WPD file), the driver expands the
  3347. Options dialog box to give user control of duplex settings.
  3348.  
  3349.  
  3350. 6.9 PostScript Header Support
  3351.  
  3352. The size of the PostScript header is less than 8K. Most header functions
  3353. are efficient and compact. This minimizes the overhead of print jobs that
  3354. include the header to just a few seconds.
  3355.  
  3356. Users who want to reduce printing times as much as possible should download
  3357. the header to their printer using the Print Options dialog to make all the
  3358. functions used be resident in the printer. With the header in place,
  3359. printing times are reduced by about 10 seconds. However, for sending files
  3360. to service bureaus, the header must be included in the print job and not
  3361. downloaded previously.
  3362.  
  3363.  
  3364. 6.10 Automatic Error Handler
  3365.  
  3366. The Windows 3.1 driver automatically downloads an error handler that exists
  3367. for the life of a job. The error handler provides valuable feedback for the
  3368. user. If an error occurs, the handler prints a brief message telling the
  3369. user what happened and what to do about it, followed by the command and a
  3370. trace of the stack at the time of the error. This information can be used
  3371. to correct the problem, or give the support staff help in determining the
  3372. problem.
  3373.  
  3374.  
  3375. 6.11 Automatic Handshaking
  3376.  
  3377. A common error is mismatched protocol settings between Control Panel and
  3378. the PostScript driver. The Windows 3.1 driver will automatically download
  3379. code to the printer to select the appropriate handshaking if the printer is
  3380. connected to a serial port. If the printer is connected to a parallel port
  3381. hardware, standard handshaking is used; network connections do not require
  3382. handshaking. Consequently, the Handshake button has been removed.
  3383.  
  3384.  
  3385. 6.12 EPS Printing
  3386.  
  3387. Users can produce an Encapsulated PostScript (EPS) file that can be
  3388. imported into applications such as Aldus PageMaker with any Windows
  3389. application that prints using the PostScript driver. This is done by
  3390. selecting the Print to EPS File option from the PostScript Options dialog
  3391. box, and then printing. The output of the print job is redirected into the
  3392. PostScript-only EPS file specified in the Options dialog box. No alternate
  3393. representation of the image (for example, metafile or TIFF image) is
  3394. produced by the driver.
  3395.  
  3396. By default, the bounding rectangle is the whole page (that is, the
  3397. imageable area of the page). If the printing application issues a
  3398. SET_BOUNDS escape, that rectangle will be used instead of the whole page.
  3399. Therefore, before printing a page, every application that might possibly
  3400. have its output sent to an EPS file should issue a SET_BOUNDS escape with
  3401. the bounding rectangle of all the output.
  3402.  
  3403.  
  3404. 6.13 Detectable Start of Page
  3405.  
  3406. In Windows 3.1, the PostScript driver calls the StartPage function at the
  3407. beginning of each page. Users can define their own StartPage function to
  3408. carry out any per-page processing.
  3409.  
  3410.  
  3411. 6.14 Document-Structuring Convention Support
  3412.  
  3413. The Windows 3.1 PostScript driver can generate output that conforms to the
  3414. document-structuring conventions defined by Adobe. These conventions make
  3415. it easier for applications to parse and rearrange PostScript output to
  3416. perform special operations, or print more efficiently. Users should request
  3417. conforming output if they plan on using the PostScript output as input to
  3418. another program that processes PostScript files. (This option does not need
  3419. to be checked for EPS files.)
  3420.  
  3421. The driver creates output that conforms to the Document-Structuring
  3422. Convention (DSC) only if the user chooses the Generate Conforming Output
  3423. option in the Advanced Setup dialog box. If this option is not explicitly
  3424. set, the driver may optimize output for printing efficiency and therefore
  3425. cannot guarantee conformance with DSC. In particular, the optimized output
  3426. may not be page independent as specified by the conventions. That is, pages
  3427. may need to be printed in a specific order, relying on fonts or other
  3428. resources loaded from previous pages. For more information about
  3429. DSC-conforming output, see version 3.0 of Adobe's Document Structuring
  3430. Conventions.
  3431.  
  3432.  
  3433. 6.15 Color
  3434.  
  3435. The PostScript driver is a one bit-per-pixel device. However, this does not
  3436. mean it can represent only black and white. Bitmaps in a one bit-per-pixel
  3437. format can use any color for the foreground and background.
  3438.  
  3439. On black and white devices, colors are converted to gray levels by the
  3440. PostScript color machinery. For example, when a bitmap is transferred to
  3441. the printer, the foreground and background colors are examined to determine
  3442. the two colors to use for the transfer.
  3443.  
  3444. Windows uses brushes to fill objects. Patterned brushes are defined by an
  3445. 8x8 bitmap that is used to tile a region that is to be filled. However,
  3446. since the PostScript driver is a one bit-per-pixel device, there is no
  3447. color information stored in its brushes. When a brush is used to fill an
  3448. object, the current text and background colors are used.
  3449.  
  3450. In Windows 3.1, the user can force all colors (other than white) to print
  3451. as black by setting the All Colors to Black option in the Advanced Options
  3452. dialog box. This option is useful if a printout loses detail from thin,
  3453. light-colored areas.
  3454.  
  3455.  
  3456. 6.16 Color-Separation Support
  3457.  
  3458. To provide minimal support for color separation, the Windows 3.1 PostScript
  3459. driver recognizes the scignore variable in the PostScript header. Setting
  3460. this variable to True disables all color change commands allowing the
  3461. application to perform multiple passes over the input, setting the current
  3462. color to be the correct process color.
  3463.  
  3464. Before starting color separation, an application must set the scignore
  3465. variable using the PASSTHROUGH escape and the following string:
  3466.  
  3467.     /scignore true def
  3468.  
  3469. 6.17 Device-Independent Bitmaps
  3470.  
  3471. Device-independent bitmaps (DIBs) are used to deal with more than one
  3472. bit-per-pixel bitmaps. The implementation in the PostScript driver uses the
  3473. PostScript image operator on black and white devices and the colorimage
  3474. operator on color devices to render multiple bit-per-pixel images. (Notice,
  3475. however, that this makes the output printer dependent.)
  3476.  
  3477. Applications that want to print multiple bit-per-pixel images should use
  3478. the SetDIBitsToDevice or StretchDIBitsToDevice function to render these
  3479. images. GDI will simulate these if the driver does not support them.
  3480.  
  3481.  
  3482. 6.18 StretchBlt Support
  3483.  
  3484. The PostScript driver supports arbitrary scaling of bitmap images. This
  3485. means applications can call the StretchBlt function without GDI
  3486. intercepting the call and carrying out the scaling on its own. With
  3487. StretchBlt implemented in the PostScript driver, the source bitmap is
  3488. transferred directly to the printer and stretched using the PostScript
  3489. imagemask operator. A run-length encoding (RLE) compression scheme has also
  3490. been implemented to reduce the amount of data that needs to be transferred
  3491. to the printer.
  3492.  
  3493.  
  3494. 6.19 Compressed Bitmaps
  3495.  
  3496. The user can direct the PostScript driver to compress bitmaps before
  3497. sending them to the printer by setting the Compress Bitmap option in the
  3498. Advanced Options dialog box. Compressing bitmaps speeds up the generation
  3499. of the PostScript output but slows down the printer itself (PostScript
  3500. printers need more time to decompress the bitmaps). This option is
  3501. recommended only if the user is more concerned about having the printing
  3502. application finish quickly than with how long it takes to get the printout.
  3503.  
  3504.  
  3505. 6.20 Font Management
  3506.  
  3507. The Windows 3.1 PostScript driver encloses each page in a gsave/grestore
  3508. pair to restore the graphics state (reclaim memory) without deleting
  3509. downloaded fonts. Also, the driver now calculates memory consumption during
  3510. the course of a print job, and will flush downloaded fonts at the start of
  3511. any page if memory is low.
  3512.  
  3513. Users can modify this behavior by setting the Printer VM and the Per Page
  3514. Font Downloading options in the Advanced Options dialog box. The Printer VM
  3515. option specifies how much available memory is in the printer. The driver
  3516. uses this setting when calculating memory usage. The Per Page Font
  3517. Downloading option directs the driver to flush printer memory at the end of
  3518. every page regardless of how much free memory exists. Essentially, this
  3519. option forces the driver to downloaded fonts with each page.
  3520.  
  3521.  
  3522. 6.21 TrueType Support
  3523.  
  3524. The Windows 3.1 PostScript driver supports TrueType fonts allowing users to
  3525. create and print document containing TrueType fonts on PostScript printers.
  3526. The driver also provides a variety of advanced options that let the user
  3527. determine how TrueType fonts are to be used with the printer. Depending on
  3528. the capabilities of the printer, the user may want to convert TrueType
  3529. fonts to an Abode format, or substitute the TrueType font with a
  3530. printer-resident font.
  3531.  
  3532. The PostScript driver may need to convert the fonts to PostScript
  3533. device-font format before downloading to the printer. This is true if the
  3534. printer does not support the TrueType font format itself. If the driver
  3535. must convert TrueType fonts, it can convert them to either Adobe Type 3
  3536. bitmap fonts or Type 1 outline fonts. The user sets the type in the
  3537. TrueType option in the Advanced Options dialog box. The TrueType to Type 1
  3538. conversion is not exact and may produce fonts of slightly inferior quality
  3539. to the original TrueType font. However, using this conversion will reduce
  3540. print time and require much less printer memory for documents containing
  3541. lots of TrueType fonts at large point sizes.
  3542.  
  3543. The user can direct the PostScript driver to substitute PostScript
  3544. printer-resident fonts for TrueType fonts by using the Substitution option
  3545. in the Advanced Options dialog box. This option displays another dialog box
  3546. that lists the TrueType fonts and lets the user choose the substitution
  3547. font. Using substitution fonts reduces print time and requires less printer
  3548. memory.
  3549.  
  3550. If the printer supports the TrueType font format, the user can also direct
  3551. the driver to download TrueType fonts to the printer by using the
  3552. Substitution option in the Advanced Options dialog box. In this case, the
  3553. user sets the Download as a SoftFont option for a TrueType font instead of
  3554. choosing a printer-resident font. The driver converts the TrueType font to
  3555. a soft font and downloads it to the printer. This is the default for any
  3556. TrueType font that hasn't been assigned a printer font in the substitution
  3557. table.
  3558.  
  3559.  
  3560. 6.22 Rotated Text
  3561.  
  3562. The PostScript driver can support printing text at any angle. Applications
  3563. may create fonts using any Escapement value (that is, by specifying the
  3564. angle of the baseline). The only limitation is that the Orientation (that
  3565. is, the angle of individual characters) is ignored.
  3566.  
  3567.  
  3568. 6.23 Escapes
  3569.  
  3570. There are four PostScript-related printer escapes: EPSPRINTING,
  3571. POSTSCRIPT_DATA, POSTSCRIPT_IGNORE, and GETSETSCREENPARAMS.
  3572.  
  3573. The EPSPRINTING escape is intended for applications that produce their own
  3574. PostScript. It suppresses the Windows PostScript header. With this option
  3575. on, no GDI output functions will work.
  3576.  
  3577. The POSTSCRIPT_DATA escape is just like the PASSTHROUGH (also known as
  3578. DEVICE_DATA) escape except that it is recognized only by PostScript
  3579. devices. This escape is intended for applications that produce two
  3580. representations of the output: one intended for PostScript devices and the
  3581. other for non-PostScript devices. It should be used in conjunction with
  3582. POSTSCRIPT_IGNORE to make the PostScript driver ignore the GDI
  3583. representation.
  3584.  
  3585. The POSTSCRIPT_IGNORE escape is used to make the PostScript driver ignore
  3586. or accept all the output. The lpInData parameter points to a Boolean value
  3587. that indicates whether the GDI functions should be ignored (TRUE) or not
  3588. (FALSE, the default).
  3589.  
  3590. The GETSETSCREENPARAMS escape, new for Windows 3.1, sets and retrieves the
  3591. current screen parameters, such as angle and frequency, for halftoning. The
  3592. user can also set these parameters by using the Halftone Frequency and
  3593. Halftone Angle options in the Advanced Options dialog box.
  3594.  
  3595. Detailed descriptions of other escapes are available in the Microsoft
  3596. Windows Device Driver Adaptation Guide which has driver-oriented
  3597. descriptions.
  3598.  
  3599.  
  3600. 6.24 PostScript Printer Communications
  3601.  
  3602. Most PostScript printers support both serial and parallel ports. The
  3603. fastest and most efficient way to connect your printer to your computer is
  3604. usually with a parallel port (LPTx). If your printer has both a parallel
  3605. and a serial port, the parallel port should be used.
  3606.  
  3607. If you are using serial communications and have a newer PostScript printer,
  3608. you may be able to increase the transmission rate from the standard 9600
  3609. baud. Many printers support communications of 19,200 baud.
  3610.  
  3611. The following is a PostScript program that can be sent to the printer to
  3612. set it up for 19,200-baud communications. Save the following in a file
  3613. called 19200.PS and then use the MS-DOS copy command (COPY 19200.PS COM1:)
  3614. to send it to the printer.
  3615.  
  3616.     % set laserwriter for 19200 baud
  3617.     %   set up hardware handshaking
  3618.     %   see page 121-122 of apple manual for details
  3619.     %   use ETX/ACK (cts/rts)
  3620.     serverdict begin 0 exitserver
  3621.     statusdict begin 25 19200 7 setsccbatch end
  3622.     % a ^D should be appended to this file in most cases
  3623. NOTE This will set the speed permanently (even after a power cycle). Use
  3624. the following PostScript program to reset the communications channel to the
  3625. default 9600 baud.
  3626.  
  3627.     % set laserwriter for 9600 baud
  3628.     %   set up hardware handshaking
  3629.     %   see page 121-122 of apple manual for details
  3630.     %   use ETX/ACK (cts/rts)
  3631.     serverdict begin 0 exitserver
  3632.     statusdict begin 25 9600 0 setsccbatch end
  3633.     % a ^D should be appended to this file in most cases
  3634. You will also have to set the port on the computer to this speed by issuing
  3635. the following command, which should go in your AUTOEXEC.BAT file:
  3636.  
  3637.     MODE COM1:,19200,n,8,1
  3638.  
  3639. 6.25 Driver Limitations
  3640.  
  3641. The following are limitations placed on the driver by PostScript:
  3642.  
  3643. o   PostScript does not support most raster operations (Rops). However, it
  3644.     does support BLACKNESS, WHITENESS, and SRCCOPY.
  3645.  
  3646. o   PostScript has a 750-point polygon limit. This number is reduced by two
  3647.     when filling with a hatch or pattern. This is because a clipping path
  3648.     must be built as well as the path to fill and stroke. In cases where
  3649.     this limit is reached, the driver will request that GDI simulate the
  3650.     polygon. This is very slow. Applications should avoid generating large
  3651.     polygons.
  3652.  
  3653. Chapter 7  External PostScript Printers
  3654.  
  3655. In addition to supporting a wide variety of PostScript printers, the
  3656. Microsoft Windows PostScript printer driver can also support any new
  3657. PostScript printers for which the user installs an external printer
  3658. definition.
  3659.  
  3660. For the user to be able to do this, the printer manufacturer must supply a
  3661. Windows Printer Description (WPD) file that contains information about the
  3662. new printer. Printer manufacturers create the WPD files by compiling
  3663. Adobe-standard PostScript Printer Description (PPD) files with the MKPRN
  3664. utility. This chapter describes how font manufacturers can build the WPD
  3665. files and distribution disks that will enable users to add a printer to the
  3666. Microsoft Windows PostScript printer driver.
  3667.  
  3668.  
  3669. 7.1 Building and Distributing WPD Files
  3670.  
  3671. To build Windows Printer Description files, a font manufacturer must first
  3672. build PPD files for each printer and PFM files for the each printer's
  3673. resident font or soft fonts. The font manufacturer then uses the MKPRN
  3674. utility to generate the WPD file.
  3675.  
  3676. To distribute WPD files, a font manufacturer copies the WPD file to disk
  3677. along with a OEMSETUP.INF file that describes the external printers the WPD
  3678. file supports.
  3679.  
  3680. Once a WPD file is installed, it defines the following features of the
  3681. external printer:
  3682.  
  3683. o   Resident fonts
  3684.  
  3685. o   Paper sizes and input trays
  3686.  
  3687. o   Commands that activate sizes and trays
  3688.  
  3689. o   Imageable area of each supported page size (that is, the area on which
  3690.     the printer can actually mark)
  3691.  
  3692. The following sections describe the formats of the various files.
  3693.  
  3694.  
  3695. 7.2 PostScript Printer Description Files
  3696.  
  3697. The PostScript Printer Description file format, defined by Adobe and
  3698. extended by the Microsoft, provides the basis for external printer
  3699. descriptions. This ASCII file contains one or more statements, each
  3700. consisting of a keyword and associated values.
  3701.  
  3702. Each keyword defines a feature of the PostScript printer. The associated
  3703. values specify whether the feature is available, or how the feature affects
  3704. the operation of the printer. For example, the *FileSystem keyword
  3705. specifies whether a printer supports fonts loaded on a hard drive. PPD
  3706. files must be standard ASCII files with carriage return and line feed pairs
  3707. terminating each line.
  3708.  
  3709. To ensure the best performance for a printer, the PPD file should be as
  3710. complete as possible. Windows 3.1 has defined new PPD keywords that should
  3711. be added to existing PPD files to create new WPD files. If these keywords
  3712. are not added, the driver can still use the old WPD files, but it will
  3713. assign default values to any keywords not explicitly defined.
  3714.  
  3715. The following provides descriptions of the PPD keywords.
  3716.  
  3717. Keyword                Description
  3718. ---------------------------------------------------------------------------
  3719.  
  3720. *ColorDevice           Indicates whether the printer supports color.
  3721.  
  3722. *DefaultFont           The name of the default font (that is, the font used
  3723.                        if none is selected). This setting must appear
  3724.                        before any *Font settings.
  3725.  
  3726. *DefaultInputSlot      The default input slot.
  3727.  
  3728. *DefaultResolution     The default resolution of the printer.
  3729.  
  3730. *Duplex                PostScript commands to set duplex mode. This feature
  3731.                        is new for Windows 3.1.
  3732.  
  3733. *FileSystem            Reserved; do not use.
  3734.  
  3735. *Font                  The fonts resident in the printer.
  3736.  
  3737. *FreeVM                Amount of free memory in standard printer
  3738.                        configuration. This feature is new for Windows 3.1.
  3739.  
  3740. *ImageableArea         The actual area that can be marked on for every
  3741.                        paper size.
  3742.  
  3743. *InputSlot             The PostScript code that is necessary to specify
  3744.                        each input slot.
  3745.  
  3746. *ManualFeed False      The PostScript code that is necessary to turn off
  3747.                        manual feed. If present, it is assumed that manual
  3748.                        feed is supported.
  3749.  
  3750. *ManualFeed True       The PostScript code that is necessary to specify the
  3751.                        manual feed operation. If present, it is assumed
  3752.                        that manual feed is supported (and therefore
  3753.                        PageRegion settings must be included).
  3754.  
  3755. *NickName              The name that appears in the printer dialog box. It
  3756.                        should be a unique description of the printer. This
  3757.                        is also the name used for automatic printer
  3758.                        recognition.
  3759.  
  3760. *PageRegion            The PostScript code that is necessary to specify
  3761.                        different page sizes when using manual feed.
  3762.  
  3763. *PageSize              The PostScript code used to specify the different
  3764.                        page sizes that are supported (when not in
  3765.                        manual-feed mode).
  3766.  
  3767. *PaperDimension        The size of all the used paper types. A Paper
  3768.                        Dimension setting must be included for every size of
  3769.                        paper supported. The sizes of the standard page
  3770.                        types should be used. Only standard page types are
  3771.                        recognized.
  3772.  
  3773. *SetResolution         Used to determine the hardware resolution(s)
  3774.                        supported. This feature is new for Windows 3.1.
  3775.  
  3776. *Transfer Normalized   The normalized transfer function used to generate
  3777.                        linear gray levels. This must be present. If none is
  3778.                        required, include the nul function { }.
  3779.  
  3780. The following is a list of PPD extensions.
  3781.  
  3782. Extension           Description
  3783. ---------------------------------------------------------------------------
  3784.  
  3785. *AcceptsTrueType:   True or false. If true, TrueType fonts will be
  3786.                     downloaded natively using readhexsfnt operator. This is
  3787.                     selected through the download option in the Advanced
  3788.                     Options dialog box. If false, TrueType will not be
  3789.                     displayed as a selection. This feature is new for
  3790.                     Windows 3.1.
  3791.  
  3792. *EndOfFile          Indicates whether ^D is required to indicate the end of
  3793.                     the file. This is true by default, and only needs to be
  3794.                     included if this is false (that is, *EndOfFile False).
  3795.  
  3796. *SetPage            True or false. If true, the PostScript driver allows a
  3797.                     custom paper size to be defined. This is implemented
  3798.                     through the use of the setpage operator. If your
  3799.                     printer supports the setpage operator in the same
  3800.                     manner as Linotronic(R) printers, you can use this
  3801.                     option.
  3802.  
  3803. *TrueImageDevice:   True or false. If true, the PostScript driver takes
  3804.                     advantage of some optimizations available in TrueImage.
  3805.                     Currently there is very little difference in the
  3806.                     output. This feature is new for Windows 3.1.
  3807.  
  3808. The following are the paper keywords used to show the paper sizes
  3809. supported.
  3810.  
  3811. Keyword        Description
  3812. ---------------------------------------------------------------------------
  3813.  
  3814. 10x14          10 x 14 inches physical size, oriented in portrait mode.
  3815.  
  3816. 11x17          11 x 17 inches physical size, oriented in portrait mode. Can
  3817.                be used interchangeably with the keyword Tabloid.
  3818.  
  3819. A3             297 x 420 millimeters physical size, oriented in portrait
  3820.                mode. Refers to the International Standards Organization
  3821.                (ISO)/(JIS) A3 paper size.
  3822.  
  3823. A4             210 x 297 millimeters physical size, oriented in portrait
  3824.                mode.
  3825.  
  3826. A4Extra        9.27 x 12.69 inches physical size.
  3827.  
  3828. A4Small        210 x 297 millimeters physical size, but with a reduced-size
  3829.                imageable area of 7.47 x 10.85 inches that is centered on an
  3830.                A4 page. Supports the Adobe PostScript paper definitions.
  3831.  
  3832. A5             148 x 210 millimeters physical size, oriented in portrait
  3833.                mode.
  3834.  
  3835. B4             250 x 354 millimeters physical size, oriented in portrait
  3836.                mode. Refers to the Japanese Industrial Standard (JIS) B4
  3837.                paper size.
  3838.  
  3839. B5             182 x 257 millimeters physical size, oriented in portrait
  3840.                mode.
  3841.  
  3842. Folio          8.5 x 13 inches physical size, but with a reduced-size
  3843.                imageable region, oriented in portrait mode and centered on
  3844.                the folio sheet. Supports the Adobe PostScript paper
  3845.                definitions.
  3846.  
  3847. Ledger         17 x 11 inches physical size, oriented in landscape mode
  3848.                (that is, the y-axis is on the shorter edge of the paper).
  3849.  
  3850. Legal          8.5 x 14 inches physical size, oriented in portrait mode.
  3851.  
  3852. LegalExtra     9.5 x 15 inches physical size.
  3853.  
  3854. Letter         8.5 x 11 inches physical size. Refers to the standard paper
  3855.                type.
  3856.  
  3857. LetterExtra    9.5 x 12 inches physical size.
  3858.  
  3859. LetterSmall    8.5 x 11 inches physical size, but with a reduced-size
  3860.                imageable region that is centered on the page. Supports the
  3861.                Adobe PostScript paper definitions.
  3862.  
  3863. Note           8.5 x 11 inches physical size, but with a reduced-size
  3864.                imageable region. This is used to reduce the size of the
  3865.                page buffer to give print jobs more memory.
  3866.  
  3867. Quarto         215 x 275 millimeters physical size, but with a reduced-size
  3868.                imageable region, oriented in portrait mode and centered on
  3869.                the quarto sheet.
  3870.  
  3871. Statement      5.5 x 8.5 inches physical size, oriented in portrait mode.
  3872.  
  3873. Tabloid        11 x 17 inches physical size, oriented in portrait or
  3874.                tabloid mode (that is, the y-axis is on the longer edge of
  3875.                the paper).
  3876.  
  3877. TabloidExtra   11.69 x 18 inches physical size.
  3878.  
  3879. For paper extensions, five standard envelope sizes are recognized. The two
  3880. groups of numbers following the word Envelope indicate the size of the
  3881. envelope in points (where each point equals 1/72 of an inch).
  3882.  
  3883. Extension          Description
  3884. ---------------------------------------------------------------------------
  3885.  
  3886. Envelope.279.639   #9 Envelope (3.875 x 8.875 inches)
  3887.  
  3888. Envelope.297.684   #10 Envelope (4.125 x 9.5 inches)
  3889.  
  3890. Envelope.324.747   #11 Envelope (4.5 x 10.375 inches)
  3891.  
  3892. Envelope.342.792   #12 Envelope (4.75 x 11 inches)
  3893.  
  3894. Envelope.360.828   #14 Envelope (5 x 11.5 inches)
  3895.  
  3896. The following are the paper tray and bin keywords used to show and specify
  3897. the input slots supported.
  3898.  
  3899. Keyword         Description
  3900. ---------------------------------------------------------------------------
  3901.  
  3902. LargeCapacity   This one can hold more than a standard amount of paper.
  3903.  
  3904. Lower           If there is more than one tray, this one is on the bottom.
  3905.  
  3906. Middle          This one is in the middle.
  3907.  
  3908. OnlyOne         There is only one tray.
  3909.  
  3910. Upper           If there is more than one tray, this one is on top.
  3911.  
  3912. The following list describes the paper tray extensions.
  3913.  
  3914. Extension        Description
  3915. ---------------------------------------------------------------------------
  3916.  
  3917. AutoSelect       Printer can select automatically which feeder to use. This
  3918.                  is followed by the code (or a nul command if no code is
  3919.                  required) that is used to specify the autofeed mechanism.
  3920.  
  3921. Envelope         There is an envelope feeder.
  3922.  
  3923. EnvelopeManual   There is a manual envelope feeder.
  3924.  
  3925. None             There are no input feeders. This is treated as being the
  3926.                  same as OnlyOne.
  3927.  
  3928. The following keywords are required to support duplex printing.
  3929.  
  3930. Keyword                   Definition
  3931. ---------------------------------------------------------------------------
  3932.  
  3933. *Duplex DuplexNoTumble:   statusdict begin false settumble true
  3934.                           setduplexmode end
  3935.  
  3936. *Duplex DuplexTumble:     statusdict begin true settumble true
  3937.                           setduplexmode end
  3938.  
  3939. *Duplex None:             statusdict begin false setduplexmode end
  3940.  
  3941. *DefaultDuplex            None
  3942.  
  3943. If the PPD with correct *Duplex settings is built with the Windows 3.1
  3944. MKPRN utility, the driver expands the Options dialog box to give user
  3945. control of duplex settings.
  3946.  
  3947.  
  3948. 7.3 PFM Files for PostScript Printers
  3949.  
  3950. Because PostScript fonts are scalable, the PFM files for the PostScript
  3951. fonts do not contain width tables. The files have the following form:
  3952.  
  3953.     PFMHEADER       Header;          /* font header */
  3954.     PFMEXTENSION    Extensions;      /* extensions */
  3955.     char            DeviceName[];    /* printer device name */
  3956.     char            FaceName[];      /* font face name */
  3957.     EXTTEXTMETRIC   ExtTextMetrics;  /* extended text metrics */
  3958.     WORD            ExtentTable[];   /* unscaled character widths */
  3959.     DRIVERINFO      DriverInfo;      /* driver-specific information */
  3960.     PAIRKERN        KerningPairs[];  /* pair-kerning table (optional)*/
  3961.     KERNTRACK       KerningTracks[]; /* track-kerning table (optional)*/
  3962. The PostScript driver for Windows assumes all PostScript fonts are scalable
  3963. fonts, so it ignores the dfPoints and dfPixHeight members in the PFM
  3964. header. The members dfAvgWidth and dfMaxWidth are in units of 1000
  3965. units-per-em.
  3966.  
  3967. Although the PostScript naming convention includes the attributes of the
  3968. font (that is, bold and italic) in the font name, the attributes should be
  3969. stripped from the font name and represented in the dfWeight and dfItalic
  3970. members in the PFM header.
  3971.  
  3972. The extent table is an array of 16-bit values containing the unscaled
  3973. widths of the characters and assuming 1000 units-per-em. The range of the
  3974. table should be from dfFirstChar to dfLastChar. The size of the table
  3975. should be dfLastChar - dfFirstChar + 1.
  3976.  
  3977. Pair-kern values should be in the same 1000 units-per-em measurement as the
  3978. extents. As of this writing, we do not know of any application that uses
  3979. the track-kern table.
  3980.  
  3981. In the EXTTEXTMETRIC structure, the PostScript driver assumes the following
  3982. values for each font:
  3983.  
  3984. dfVertRes = 300
  3985.  
  3986. etmMasterHeight = 300
  3987.  
  3988. etmMasterUnits = 1000
  3989.  
  3990. In other words, the driver assumes all fonts use Adobe's standard 1000
  3991. units-per-em method for describing a font. You must build the extent table
  3992. based upon 1000 units-per-em to be consistent with this restriction in the
  3993. driver.
  3994.  
  3995. The driver also assumes that the font may be scaled to any point size the
  3996. application requests. We recommend that the true scaling range of the font
  3997. be indicated in the etmMinScale and etmMaxScale members (in device units,
  3998. at 300 dpi). The driver currently ignores these members.
  3999.  
  4000. Because the Windows PostScript driver assumes all PostScript fonts are
  4001. scalable fonts, it ignores the etmPointSize member. The etmSize member is
  4002. not the point size, but rather the size (that is, the number of bytes) of
  4003. the EXTTEXTMETRIC structure.
  4004.  
  4005. As of this writing, we do not know of any application that uses the members
  4006. in the EXTTEXTMETRIC structure except for etmKernPairs. If your font
  4007. contains kern pairs, you must fill in the EXTTEXTMETRIC structure to
  4008. indicate the number of kern pairs. Do not leave the other members blank;
  4009. fill them in with reasonable values in the event an application does use
  4010. them.
  4011.  
  4012. The driver-specific data structure pointed to by dfDriverInfo is a
  4013. null-terminated string containing the PostScript name for the font. There
  4014. are two names for the font:
  4015.  
  4016. o   The Windows name for the font which appears in the font list in the
  4017.     application's font dialog box.
  4018.  
  4019. o   The PostScript name for the font, which can vary according to printer
  4020.     manufacturer and which the driver sends to the printer to select the
  4021.     font.
  4022.  
  4023. Both strings must be null-terminated. The Windows name for the font is
  4024. pointed to by dfFace and the PostScript name for the font is pointed to by
  4025. dfDriverInfo.
  4026.  
  4027. To create a PFM file for the internally-supported printers, Microsoft
  4028. converts Font Metric (AFM) files to the PFM file format. These files,
  4029. provided with the DDK, are ASCII files that define the metrics for each
  4030. font. There are 63 AFM files supporting 63 unique fonts. Printers with
  4031. resident fonts that are not supported in the current version of the driver
  4032. will need to define those files as soft fonts.
  4033.  
  4034. If you need to define a font that is not available currently in the
  4035. PostScript printer driver, you will need to modify the driver sources to
  4036. add additional AFM files. Please refer to the PostScript driver's MAKE file
  4037. that is included on the DDK disks for more information on how the driver
  4038. builds AFM and PFM files.
  4039.  
  4040.  
  4041. 7.4 Printers Setup File
  4042.  
  4043. The printers setup file (OEMSETUP.INF) should reside on the disk
  4044. distributed with the WPD file. This file follows the standard format used
  4045. in the Windows CONTROL.INF file. It contains a [io.device] section that
  4046. lists the PostScript printer names for each set of WPD files included on
  4047. the disk. The file has the same form as the following example:
  4048.  
  4049.     [io.device]
  4050.     7:pscript.DRV,7:L630_52&.WPD,"Linotronic 630","DEVICESPECIFIC"
  4051. If the user tries to install a printer that is already installed, the
  4052. printer driver will ask whether the previous WPD file should be updated.
  4053.  
  4054. Manufacturers that are already supported internally in the driver should
  4055. not provide WPD files with names that conflict with those used internally.
  4056. If an update is required, add the PostScript version number to the printer
  4057. name (in both the OEMSETUP.INF file and the *NickName section of the PPD
  4058. file).
  4059.  
  4060.  
  4061. 7.5 Compiling with the MKPRN Utility
  4062.  
  4063. The MKPRN utility, an MS-DOS utility, takes a PPD file and all the PFM
  4064. files referenced in the PPD file, and produces the WPD file needed for a
  4065. printer to be supported by the Windows PostScript printer driver. The
  4066. utility has the following command syntax:
  4067.  
  4068.     mkprn [/v] [/s] ppd-file
  4069. Parameter   Description
  4070. ---------------------------------------------------------------------------
  4071.  
  4072. /v          An optional verbose switch. This causes MKPRN to print messages
  4073.             as it processes various elements in the PPD file. This may be
  4074.             useful for debugging PPD files.
  4075.  
  4076. /s          Suppresses combining the PSS, CAP, and DIR files into one WPD
  4077.             file. This is used only when building the driver sources, and
  4078.             is not intended for use by external printers.
  4079.  
  4080. ppd-file    This is the base filename (with no extension) of the PPD file
  4081.             to be processed. The WPD file shares this base filename.
  4082.  
  4083. Error messages are printed for fonts that are not found and for identifiers
  4084. that are not recognized. If fonts are not found, they are not built into
  4085. the WPD file and have to be added as soft fonts as described in the next
  4086. section.
  4087.  
  4088.  
  4089. 7.6 Soft Fonts
  4090.  
  4091. A soft font installer is not available yet for the PostScript printer
  4092. driver. Therefore, it is up to the printer manufacturer to install
  4093. additional fonts as soft fonts by adding the appropriate WIN.INI entries.
  4094.  
  4095. The softfontn settings in WIN.INI can be used for several different
  4096. purposes. Basically, they inform the driver that a given printer has extra
  4097. fonts available and, if necessary, indicate a file that needs to be
  4098. downloaded to make that font available. If there is a second file listed in
  4099. a softfontn setting, it is assumed that it needs to be downloaded to
  4100. activate the given font. Thus, soft fonts can be used to support resident
  4101. printer fonts that have been downloaded previously, that reside on a
  4102. printer's hard drive, or that are available in some other form.
  4103.  
  4104. The softfonts setting indicates how many soft fonts are installed and
  4105. listed. The maximum number of soft fonts allowed is based on available
  4106. memory and other considerations. The maximum number of soft fonts is at
  4107. least 450.
  4108.  
  4109. Each softfontn setting references the PFM file associated with a soft font
  4110. and, optionally, the soft font that will be downloaded to the printer at
  4111. print time. Each filename may be a complete pathname. The two forms of soft
  4112. fonts supported are described in the following subsections.
  4113.  
  4114.  
  4115. 7.6.1 Adobe Soft-Font Format
  4116.  
  4117. Adobe soft fonts (files with an .AGB extension) are recognized by the
  4118. following string:
  4119.  
  4120.     %!PS-AdobeFont
  4121. The string must be located at offset 6 in the file. The first 6 bytes are
  4122. defined by the following data structure:
  4123.  
  4124.     typedef struct{
  4125.             unsigned char flag;
  4126.             char type;      /* 1 means data is ASCII, 2 means binary */
  4127.                             /*    (convert to ascii) */
  4128.             long length;    /* length of the data that follows */
  4129.             } HDR;
  4130. The members indicate the length of the soft font as well as the type (ASCII
  4131. or binary). Binary forms are converted to hexadecimal ASCII by the driver;
  4132. ASCII fonts are copied directly.
  4133.  
  4134.  
  4135. 7.6.2 Non-Adobe Soft-Font Format
  4136.  
  4137. Fonts that do not have the above-mentioned signature are copied to the
  4138. output stream. Therefore, the whole file must be in PostScript code that
  4139. describes the font.
  4140.  
  4141.  
  4142. 7.7 Testing the WPD Files
  4143.  
  4144. PostScript printer manufacturers should test their WPD files before
  4145. distribution. Do the following:
  4146.  
  4147. 1.  Copy the OEMSETUP.INF and WPD files to a disk.
  4148.  
  4149. 2.  Install the printer by choosing the Add button in the Printers dialog
  4150.     box in Control Panel. Select the appropriate printer and choose the
  4151.     Install button.
  4152.  
  4153. 3.  Select the newly installed printer from the Installed Printers list
  4154.     box, and set it to be the default printer.
  4155.  
  4156. 4.  Test the following features of your printer:
  4157.  
  4158.     o   *NickName. Make sure that the model name in the Setup dialog box is
  4159.         the same as the name in the OEMSETUP.INF file, and the *NickName
  4160.         field of the PPD.
  4161.  
  4162.     o   Paper Sizes. Make sure that all the paper sizes are available and
  4163.         that the imageable areas are correct.
  4164.  
  4165.     o   Paper Sources. Test that all the paper sources can be selected
  4166.         properly.
  4167.  
  4168.     o   Normalized Transfer Function. Use an application (for example,
  4169.         Micrografx Designer 2.0) that can generate gradiated fills to make
  4170.         sure that gray levels are represented in a linear fashion.
  4171.  
  4172. If you find any problems, make the appropriate changes to the PPD file,
  4173. rebuild the WPD file, and install the new WPD over the existing one.
  4174.  
  4175. NOTE  The description string in OEMSETUP.INF needs to match the *NickName
  4176. keyword from the PPD file.
  4177.  
  4178.