The information in this article applies to:
SYMPTOMSWhen you set the FontSize property of the Printer object in Visual Basic, the font size you get may differ from the size you requested. This behavior occurs with both Postscript printer fonts and Truetype fonts. CAUSEThis behavior occurs because Windows doesn't store the requested point size. Instead, Windows stores the closest character cell height that is supported on the current printer device. The character cell height is rounded to an integer number of pixels (dots). Rounding is necessary because Windows doesn't support a fractional device unit such as half a dot (pixel). STATUSThis behavior is by design. MORE INFORMATIONAs an example, if your printer prints at 96 dots per inch (DPI) and you request a 10 point font, Windows creates a logical printer font that is exactly 13 dots high: 13 dots = CInt( (10 points * 96 DPI) / (72 points per inch) )The above CInt function rounds to the nearest integer. The conversion depends on the DPI resolution of your printer. When you set the FontSize property to 10 points, the FontSize will actually be set to 9.75 points, which is the nearest point size the printer can support at 96 DPI: 9.75 points = 13 dots * (72 points per inch) / (96 DPI)On 300 DPI printers, the minimum interval between supported font sizes is 0.24 points. You get 0.24 points per dot as a result of the following formula: (72 points per inch) / (300 DPI)On 600 DPI printers, such as with an HP LaserJet 4 driver, supported font sizes are at intervals of 0.12 points. In typesetting, a point is 1/72 of an inch. The height of fonts is usually expressed in points. Windows automatically maps the requested font or font size to the nearest one supported by the screen or printer device if that font or size does not exist on that device. Steps to Reproduce BehaviorAs an example, the Hewlett-Packard (HP) LaserJet with the HP PostScript cartridge supports point sizes down to a resolution of 0.25 point. In Visual Basic, you can set the Printer.FontSize property to a desired point size. You can set the Printer.FontName property to the PostScript font. However, the Printer.FontSize property displays font sizes at 0.24 point intervals instead of 0.25 points. You get font sizes such as 9.6, 9.84, 10.08, 10.32, 10.56, 10.8, 11.04, and so forth. Setting the font size to 11.0 points actually gives you a font with 10.8 points. The following steps reproduce this behavior:
Additional query words: 3.00 H-P laser jet HPLJ PS Apple LaserWriter
Keywords : kbcode kbPrinting |
Last Reviewed: September 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |