This operation code allows you to select one of a number of predefined fonts to use for the report. You must make this selection prior to opening the print file.
CALL "WIN$PRINTER" USING WINPRINT-SET-STD-FONT, WINPRINT-DATA GIVING RESULT
|WINPRINT-DATA|| Group item defined in
winprint.def as follows:
01 WINPRINT-DATA. 03 WPRTDATA-SET-STD-FONT. 05 WPRTDATA-STD-FONT PIC X COMP-X. 05 FILLER PIC X(21).
The font selected is used until explicitly changed or the runtime exits. You specify which font to use by moving one of the following level 78 values to WPRTDATA-STD-FONT before calling WIN$PRINTER:
|WPRTFONT-DEFAULT||Requests the printer's default font. This is the initial setting.|
|WPRTFONT-COURIER-12||Requests a 12-point TrueType Courier font.|
|WPRTFONT-COURIER-12-COMP||Requests a 12-point TrueType Courier font and rescales it so that at least 132 columns of print will fit on a page. This is similar to the compressed print mode supported by many printers.|
|WPRTFONT-COURIER-10||Requests a 10-point TrueType Courier font.|
|WPRTFONT-COURIER-10-COMP||Requests a 10-point TrueType Courier font and rescales it so that at least 132 columns of print will fit on a page.|
When you are using either of the compressed print modes, the rescaling of the font occurs when the print file is opened. This ensures that the font is scaled correctly for the current page size and orientation. The rescaling operation normally results in skinny characters, but can actually result in stretched characters if more than 132 characters would naturally fit on a page. The runtime asks the Windows TrueType font engine to scale the font to fit exactly 132 characters on a line even if more would normally fit.
You should be aware that the TrueType font engine does not always produce exact results, particularly when rescaling a font. You may end up with a font that fits more than 132 columns on a page. You may also end up with a font that is a slightly different height when compressed than when not. You can also end up with a font that is only vaguely related to the requested one if, for example, the user has removed the TrueType fonts or if the print driver cannot handle TrueType fonts. These effects are due to the internal workings of the TrueType font engine and the way that Windows handles fonts in general. Under Windows, an application cannot select a particular font. Instead, it describes the font's characteristics and Windows selects the closest matching font using a weighted-penalty system for deciding which font is the closest match. Sometimes, no font matches exactly, so Windows substitutes the font that has the closest match.