WFONT-CHOOSE-FONT
The WFONT-CHOOSE-FONT function shows a dialog window to choose a font.
Syntax:
 CALL "W$FONT" USING WFONT-CHOOSE-FONT 
                     fontHandle 
                     WFONT-DATA
              GIVING returnCode
Parameters:
WFONT-CHOOSE-FONT
Constant
 
fontHandle
USAGE HANDLE OF FONT
Not used. It should be 0.
WFONT-DATA
Group Item
Structure that describes the initial configuration of the dialog box and receives the user's selection when the dialog box is closed. Note that the dialog box is initialized with the information stored in wfont-face-data only when wfont-choose-flags contains the wfchoose-initialize flag. This group item, defined in isfonts.def, has the following structure:
 
01  wfont-data.
    03 wfont-face-data.
       05 wfont-device                 handlevalue null.
          88 wfdevice-console          value null.
          88 wfdevice-printer          value 1.
       05 wfont-name                   pic x(33).
       05 wfont-char-set               pic x comp-x.
       05 wfont-size                   pic x comp-x.
       05 wfont-bold-state             pic x comp-x.
          88 wfont-bold                value 1false zero.
       05 wfont-italic-state           pic x comp-x.
          88 wfont-italic              value 1false zero.
       05 wfont-underline-state        pic x comp-x.
          88 wfont-underline           value 1false zero.
       05 wfont-strikeout-state        pic x comp-x.
          88 wfont-strikeout           value 1false zero.
       05 wfont-pitch-state            pic x comp-x.
          88 wfont-fixed-pitch         value 1false zero.
       05 wfont-family                 pic x comp-x.
    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(2comp-x.
    03 wfont-scale-x                   float value 0.
    03 wfont-scale-y                   float value 0.
Note - members not mentioned below are not used by this function.
 
wfont-device
It is the device the function refers to. The value of this data item should be set with the condition names provided.
When wfdevice-console is set to true, the function will load a font for the current screen configuration.
When wfdevice-printer is set to true, the function will load a font for the current printer configuration.
 
wfont-name
When the function starts and wfont-choose-flags contains the wfchoose-initialize flag, the value set here is used as default font name.
When the function exits, it receives the name of the font chosen by the user.
 
wfont-size
When the function starts and wfont-choose-flags contains the wfchoose-initialize flag, the value set here is used as default font size.
When the function exits, it receives the size of the font chosen by the user.
 
wfont-bold-state
When the function starts and wfont-choose-flags contains the wfchoose-initialize flag, the value set here affects the initial value of the check-box "Bold".
When the function exits, it receives the value of the check-box "Bold".
 
wfont-italic-state
When the function starts and wfont-choose-flags contains the wfchoose-initialize flag, the value set here affects the initial value of the check-box "Italic".
When the function exits, it receives the value of the check-box "Italic".
 
wfont-underline-state
When the function starts and wfont-choose-flags contains the wfchoose-initialize flag, the value set here affects the initial value of the check-box "Underline".
When the function exits, it receives the value of the check-box "Underline".
 
wfont-strikeout-state
When the function starts and wfont-choose-flags contains the wfchoose-initialize flag, the value set here affects the initial value of the check-box "Strikethrough".
When the function exits, it receives the value of the check-box "Strikethrough".
 
wfont-pitch-state
When the function, the value is ignored.
When the function exits, and the font is a fixed-pitch font, wfont-fixed-pitch is set to true. If the font is a variable-pitch font, wfont-fixed-pitch is set to false.
wfont-choose-data - wfont-choose-flags
Flags affecting the behavior of the dialog box. Possible values, that can be added together, are:
wfchoose-fixed-only
Only fixed-pitch fonts are listed, therefore the user cannot choose a variable-pitch font.
wfchoose-initialize
The dialog box is initialized according to the values set in wfont-face-data.
wfchoose-effects-ok
Additional check-boxes are shown to allow the selection of special font effects, such as underline and strike-out.
wfont-choose-min-size
It is the minimum allowed size for the font.
wfont-choose-max-size
It is the maximum allowed size for the font.
 
wfont-angle
It is 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 90-degree angle, set WFONT-ANGLE to "90". This feature works only when printing a font, not when displaying a font on screen.
 
wfont-scale-x
It is the scale factor on the X coordinate. A value of 0 or 1 means that no scale is performed. This setting should be used only for print fonts (wfont-device = wfdevice-printer) that are not rotated (wfont-angle = 0), otherwise the effects are unpredictable.
 
wfont-scale-y
It is the scale factor on the Y coordinate. A value of 0 or 1 means that no scale is performed. This setting should be used only for print fonts (wfont-device = wfdevice-printer) that are not rotated (wfont-angle = 0), otherwise the effects are unpredictable
Return code:
returnCode can be any signed numeric data item and provides additional information:
1
Operation successful.
WFONTERR-UNSUPPORTED
The W$FONT library routine is not supported.
WFONTERR-CANCELLED
The user has pressed the Cancel button. wfontData is not updated.