Developing a Raster Printer Device Driver
The system-supplied RasDD supports most raster printers. The raster printing model designed for Windows NT uses the following general assumptions:
·The number of pins for the printer must either be one or a multiple of eight.
·Windows NT currently supports only Hewlett-Packard PCL-scalable fonts.
Other printers with scalable fonts, such as an Epson printer, can be supported by creating a minidriver with a range of font sizes rather than designing an entirely new driver.
If a printing device is not supported in Windows NT, vendors should first determine whether their device can be provided with minumum support through development of a minidriver to use with RasDD.
If vendors determine that they need to write a new raster printer driver, they can use a combination of the DDK-supplied PostScript driver and the framebuffer display driver source as a model for such a driver. There is no source code for RasDD in the DDK.
The PostScript interface driver can provide a basis for a raster printer interface driver, with modification for the hardware. A major difference between PostScript and raster drivers is that a PostScript graphics driver writes to a device-managed surface, and so must implement certain rendering entry points. A raster driver, on the other hand, enables a GDI standard bitmap, allowing GDI to handle most of the rendering. The framebuffer display driver handles rendering the latter way.
Areas that require close attention when designing a raster printer device driver include:
·If the device has hardware fonts, the driver should support the DrvTextOut and the font query calls, such as DrvQueryFont, DrvQueryFontTree, and DrvQueryFontData. For more information, see Part 1 of this manual and the function descriptions in the Graphics Driver Reference.
·If the device supports scalable fonts, this must be indicated in the IFIMETRICS structure. GDI uses XFORMOBJ to determine the size of the fonts, which, in turn, determines the commands that must be provided to the printer. The PostScript driver uses scalable (transformable) fonts, so its source code can be used as an example of implementing scalable fonts.
Supporting the DDI contains information on printer-specific driver entry points for the printer graphics and printer interface portions of a printer driver.