WFONT-DATA

The fields of WFONT-DATA are used as follows:

WFONT-DEVICE This item identifies the device that a font is associated with. When a font is associated with a particular device, it should not be used on another device, because these results are undefined. Under Windows, fonts can be shared between devices, but the size is incorrect, because Windows fonts are internally stored with their sizes represented in pixels/device-units instead of points. For example, using a screen font that is 15 pixels high on a laser printer (with 300 or 600 dpi) produces tiny letters. All settings of WFONT-DEVICE are machine-dependent except for the following:
WFDEVICE-CONSOLE This setting (default value "NULL") associates the font with the user's screen.
WFDEVICE-WIN-PRINTER    This setting (default value "1") is meaningful only under Windows systems. It associates the font with the currently selected printer for the Windows spooler. If you are using WIN$PRINTER, this item must be set to "true" before you call W$FONT.
WFONT-NAME This item holds the face name of the font. This name is case-sensitive and may contain internal spaces. When asking for a font, you must match its name exactly. If this item is set to spaces, then any font is allowed to match. Under Windows, some common True Type font names are "Courier New", "Times New Roman", and "Arial".
WFONT-SIZE This item holds the size, in points, of the font's characters. A value of zero allows for any size font. In that case, the size chosen by the system may or may not be useful. If you are not certain which size to choose, start with "10" and adjust from there.
WFONT-BOLD When this item is set to TRUE, the font is a boldface font.
WFONT-ITALIC When this item is set to TRUE, the font is italic. Note that under Windows, most controls have difficulty displaying italic fonts correctly.
WFONT-UNDERLINE When this item is set to TRUE, the font is underlined.
WFONT-CHAR-SET This item defines the character set to use. A font's character set includes the internal representations used for each character. The possible settings are as follows:
WFCHARSET-DONT-CARE    This allows for any character set. When returned by a call to WFONT-DESCRIBE-FONT, it indicates that the font's character set is unknown or does not correspond to one of the following settings. When requesting a specific font, use this setting only if you are certain that the face name you are requesting uses the character set you want. This may be necessary when you are asking for a font that uses a character set other than any of the following (as might be true for some oriental character sets).
WFCHARSET-DEFAULT This setting corresponds to a host-dependent default character set. This is the character set most commonly used by the host system. Under Windows, this is the ANSI character set. If you are not certain which setting of WFONT-CHAR-SET to use, use this one.
WFCHARSET-WIN-OEM This setting is meaningful only under Windows. It corresponds to the host hardware's "OEM" character set. For IBM-style PCs, this is the traditional MS-DOS character set. This is the same character set used by the built-in font "TRADITIONAL-FONT".
WFCHARSET-WIN-name The following settings are meaningful only in a Windows environment. They correspond to various character sets supported by Windows fonts (where name is the supported font name from the list below). You may select the character set directly in the "script" portion of the font chooser dialog box. Note that most fonts only support a subset of these character sets.
  • WFCHARSET-WIN-SYMBOL
  • WFCHARSET-WIN-SHIFTJIS
  • WFCHARSET-WIN-HANGUL
  • WFCHARSET-WIN-GB2312
  • WFCHARSET-WIN-CHINESEBIG5
  • WFCHARSET-WIN-JOHAB
  • WFCHARSET-WIN-HEBREW
  • WFCHARSET-WIN-ARABIC
  • WFCHARSET-WIN-GREEK
  • WFCHARSET-WIN-TURKISH
  • WFCHARSET-WIN-VIETNAMESE
  • WFCHARSET-WIN-THAI
  • WFCHARSET-WIN-EASTEUROPE
  • WFCHARSET-WIN-RUSSIAN
  • WFCHARSET-WIN-MAC
  • WFCHARSET-WIN-BALTIC
WFONT-STRIKEOUT When this item is set to TRUE, the font is struck-out (i.e., has a line running horizontally through the middle of the characters).
WFONT-FIXED-PITCH    When this item is set to TRUE, the font is fixed-pitch. This means that each character in the font is the same width.
WFONT-FAMILY This item describes the look of the font in very general terms. It is used to aid in selecting a font when WFONT-NAME is not specified or not found. No font is ever rejected because it does not match the requested family. Usually this field can be set to WFFAMILY-DONT-CARE, but specifying other choices can be useful when you don't know what fonts are on a system and you want to find one close to a specific font. Some graphical systems do not have the concept of font families. On these systems, the value of this field is ignored. The possible values of WFONT-FAMILY are:
WFFAMILY-DONT-CARE This setting allows for any font family. When set by WFONT-DESCRIBE-FONT, it indicates that the font family is unknown or does not match any of the following possibilities.
WFFAMILY-MODERN This setting indicates a font with a constant stroke width. These fonts are typically fixed-pitch, but need not be. Example fonts are "Courier" and "Elite".
WFFAMILY-ROMAN This setting indicates a font with variable stroke width and serifs. Example fonts include "Times Roman" and "New Century Schoolbook".
WFFAMILY-SWISS This setting indicates a font with variable stroke width and no serifs. Example fonts include "Helvetica" and "MS Sans Serif".
WFFAMILY-SCRIPT This setting indicates a font designed to look like handwriting. Example fonts are "Script" and "Comic Sans MS".
WFFAMILY-DECORATIVE This setting indicates a font for decorative or novelty purposes. "Old English" is an example of such a font.
WFONT-ANGLE This item holds a value specifying the angle at which the font will print. The value can range from the default of "0", which is the normal horizontal orientation, to "360", which is the same as "0". For example, to print at a 45-degree angle, set WFONT-ANGLE to "45". To print upside down, set it to "180". Any font supported by the destination printer can be loaded with this setting. This feature works only when printing a font, not when displaying a font on screen.
Note: You should use the WINPRINT-SET-CURSOR operation of W$PRINTER to set the position of the cursor prior to making a WRITE statement using this feature.
WFONT-CHOOSE-FLAGS This item modifies the behavior of WFONT-CHOOSE-FONT based on the following settings. You can set any combination of these by adding together the corresponding values (all contained in "fonts.def"):
WFCHOOSE-FIXED-ONLY This setting allows the user to select only a fixed-pitch font. Otherwise, any font can be chosen.
WFCHOOSE-INITIALIZE This setting causes the various fields of the dialog box to be initialized based on the values contained in WFONT-FACE-DATA. Otherwise, the fields will have no initial value.
WFCHOOSE-EFFECTS-OK This setting causes the special-effects section of the dialog box to appear. This section allows the user to select the following traits: underline, strike-out, and color. If it's not set, then this section does not appear in the dialog box.
WFCHOOSE-ANSI-ONLY As Windows has evolved, the fonts listing in the W$FONT dialog no longer contains only ANSI fonts. While UNICODE fonts may be used with ACUCOBOL-GT, using them relies on translation back and forth between locales, a process the COBOL programmer has no means of influencing. For COBOL programmers who want to let their users have the liberty of selecting fonts, it is therefore beneficial to limit the fonts to ANSI fonts only.

This setting allows the user to select only ANSI fonts. Otherwise any font can be chosen. This flag can be used in combination with any other flag value.

Note that this flag is for use with the WFONT-CHOOSE-FONT operation only. Default value is off. Programmers must make an active choice, e.g. turn this flag on, to get the functionality.

Prior to the call to W$FONT set the flag:

MOVE WFCHOOSE-ANSI-ONLY 
TO WFONT-CHOOSE-FLAGS 
CALL "W$FONT" USING 
WFONT-CHOOSE-FONT, 
NULL, WFONT-DATA 

If you have used one of the other flags for WFONT-CHOOSE-FLAGS, you can combine it with this new setting by adding instead of moving:

ADD WFCHOOSE-ANSI-ONLY TO WFONT-CHOOSE-FLAGS 
WFONT-CHOOSE-MIN-SIZE This item, when set to a positive value, specifies the minimum font size (in points) that the user can choose.
WFONT-CHOOSE-MAX-SIZE This item, when set to a positive value, specifies the maximum font size (in points) that the user can choose. When it's set to zero, no maximum is established.
WFONT-CHOOSE-RED This item is used only when the WFCHOOSE-EFFECTS-OK flag is set. It returns the red component of the color chosen. This is a number in the range of "0" to "255". See the W$PALETTE Routine for ways to use this value. On systems that do not support palettes, this value is always zero.
WFONT-CHOOSE-GREEN This item is similar to WFONT-CHOOSE-RED, except it returns the green component of the color.
WFONT-CHOOSE-BLUE This item is similar to WFONT-CHOOSE-RED, except it returns the blue component of the color.
WFONT-CHOOSE-COLOR-NUM This item is used only when the WFCHOOSE-EFFECTS-OK flag is set. It returns the ACUCOBOL-GT color number (in the range of "1" to "16") if the color chosen by the user corresponds to a color in the current window's palette. If it does not, then this value is set to zero. Non-zero values can be used directly in the COLOR phrase of a screen item to get the correct color.