W$FONT
The W$FONT library routine provides a number of functions to manage fonts.
Note: isCOBOL can handle only TrueType fonts.
Syntax:
 CALL "W$FONT" USING opCode
                     parameters
              GIVING returnCode
Parameters:
opCode
Function to be executed. Valid values, defined in isfonts.def, are:
 
Show a dialog window to choose a font
 
Retrieve font characteristics
 
Load the font matching some characteristics
 
Load a specific font
 
Check if the host system supports the W$FONT library routine
parameters
Parameters depend on the opcode.
Return code:
returnCode definition and meaning depend on the opcode.
Examples:
Example - Load the Arial font to be used on video
working-storage section.
copy "isfonts.def".  
77  wfont-status            pic s99. 
77  h-font                  handle of font.
 
procedure division.
main.
  initialize wfont-data
  move "Arial" to wfont-name
  move "11"    to wfont-size
  call "w$font" using wfont-get-font, h-font, wfont-data
       giving wfont-status
  if wfont-status < 0
     display message "w$font error: " wfont-status
     goback
  end-if.
  ...
Example - Load the Arial font to be used for printing
working-storage section.
copy "isfonts.def".  
77  wfont-status            pic s99. 
77  h-font                  handle of font.
 
procedure division.
main.
  initialize wfont-data
  move "Arial"             to wfont-name
  move "11"                to wfont-size
  set wfdevice-win-printer to true
  call "w$font" using wfont-get-font, h-font, wfont-data
       giving wfont-status
  if wfont-status < 0
     display message "w$font error: " wfont-status
     goback
  end-if.
  ...