W$FONT

The W$FONT routine provides general support for selecting fonts and determining their characteristics.

Usage

CALL "W$FONT"
    USING OP-CODE, FONT-HANDLE, WFONT-DATA
    GIVING WFONT-STATUS

Parameters

OP-CODE Numeric value Selects the W$FONT function to perform. These operations are described below.
FONT-HANDLE USAGE HANDLE or HANDLE OF FONT When retrieving a font from the system, the system stores a handle to the font in this item. With other operations, this value specifies the font to act on.
WFONT-DATA Group item as follows:
01 WFONT-DATA.
   03 WFONT-FACE-DATA.
      05 WFONT-DEVICE                  HANDLE, VALUE NULL.
         88 WFDEVICE-CONSOLE           VALUE NULL.
         88 WFDEVICE-WIN-PRINTER       VALUE 1.
      05 WFONT-NAME                    PIC X(33).
      05 WFONT-CHAR-SET                PIC X COMP-X.
         88 WFCHARSET-DONT-CARE        VALUE 0.
         88 WFCHARSET-DEFAULT          VALUE 1.
         88 WFCHARSET-WIN-OEM          VALUE 2.
         88 WFCHARSET-WIN-SYMBOL       VALUE 3.
         88 WFCHARSET-WIN-SHIFTJIS     VALUE 4.
         88 WFCHARSET-WIN-HANGUL       VALUE 5.
         88 WFCHARSET-WIN-GB2312       VALUE 6.
         88 WFCHARSET-WIN-CHINESEBIG5  VALUE 7.
         88 WFCHARSET-WIN-JOHAB        VALUE 8.
         88 WFCHARSET-WIN-HEBREW       VALUE 9.
         88 WFCHARSET-WIN-ARABIC       VALUE 10.
         88 WFCHARSET-WIN-GREEK        VALUE 11.
         88 WFCHARSET-WIN-TURKISH      VALUE 12.
         88 WFCHARSET-WIN-VIETNAMESE   VALUE 13.
         88 WFCHARSET-WIN-THAI         VALUE 14.
         88 WFCHARSET-WIN-EASTEUROPE   VALUE 15.
         88 WFCHARSET-WIN-RUSSIAN      VALUE 16.
         88 WFCHARSET-WIN-MAC          VALUE 17.
         88 WFCHARSET-WIN-BALTIC       VALUE 18.
      05 WFONT-SIZE                    PIC X COMP-X.
      05 WFONT-BOLD-STATE              PIC X COMP-X.
         88 WFONT-BOLD                 VALUE 1, FALSE 0.
      05 WFONT-ITALIC-STATE            PIC X COMP-X.
         88 WFONT-ITALIC               VALUE 1, FALSE 0. 
      05 WFONT-UNDERLINE-STATE         PIC X COMP-X.
         88 WFONT-UNDERLINE            VALUE 1, FALSE 0.
      05 WFONT-STRIKEOUT-STATE         PIC X COMP-X.
         88 WFONT-STRIKEOUT            VALUE 1, FALSE 0.
      05 WFONT-PITCH-STATE             PIC X COMP-X.
         88 WFONT-FIXED-PITCH          VALUE 1, FALSE 0.
      05 WFONT-FAMILY                  PIC X COMP-X.
         88 WFFAMILY-DONT-CARE         VALUE 0.
         88 WFFAMILY-MODERN            VALUE 1.
         88 WFFAMILY-ROMAN             VALUE 2.
         88 WFFAMILY-SWISS             VALUE 3.
         88 WFFAMILY-SCRIPT            VALUE 4.
         88 WFFAMILY-DECORATIVE        VALUE 5.
   03 WFONT-CHOOSE-DATA.
      05 WFONT-CHOOSE-FLAGS            PIC X COMP-X.
      05 WFONT-CHOOSE-MIN-SIZE         PIC X COMP-X.
      05 WFONT-CHOOSE-MAX-SIZE         PIC X COMP-X.
      05 WFONT-CHOOSE-RED              PIC X COMP-X.
      05 WFONT-CHOOSE-GREEN            PIC X COMP-X.
      05 WFONT-CHOOSE-BLUE             PIC X COMP-X.
      05 WFONT-CHOOSE-COLOR-NUM        PIC X COMP-X.
   03 WFONT-ANGLE                      PIC X(2) COMP-X.

WFONT-DATA contains parameters that are used by the various W$FONT operations. The descriptions below detail how each operation uses this data item.

WFONT-STATUS Signed numeric data item WFONT-STATUS returns the status of the operation. Unless otherwise specified below, a value of 1 indicates success and 0 or a negative value indicates failure.

All of the data items and definitions required by this routine can be found in the COPY library fonts.def. To avoid problems should the format of WFONT-DATA change in a future version of ACUCOBOL-GT, it is recommended that you always use the fonts.def COPY file.

Description

W$FONT performs a variety of operations depending on the specified op-code. The operations are as follows:
  • WFONT-SUPPORTED (op-code 1)
  • WFONT-GET-FONT (op-code 101)
  • WFONT-GET-CLOSEST-FONT (op-code 102)
  • WFONT-DESCRIBE-FONT (op-code 106)
  • WFONT-CHOOSE-FONT (op-code 2)
  • WFONT-DATA