isCOBOL Evolve : Appendices : Library Routines : W$BITMAP : WBITMAP-LOAD-SYMBOL-FONT-EX
WBITMAP-LOAD-SYMBOL-FONT-EX
The WBITMAP-LOAD-SYMBOL-FONT-EX function generates a bitmap strip from multiple combinations of font, color and text.
This is particularly useful to generate icons from symbol fonts like Font Awesome or Material Design Icons.
In thin client environment the bitmap is generated on the server and it is sent to the client later, when the program uses it.
Note - the feature is certified for Java 1.8.0_251 or higher. Previous Java versions may generate a bitmap smaller than the requested width.
Syntax:
 CALL "W$BITMAP" USING WBITMAP-LOAD-SYMBOL-FONT-EX
                       imageWidth
                       WBITMAP-LSF-DATA
                GIVING bitmapHandle
Parameters:
WBITMAP-LOAD-SYMBOL-FONT-EX
Constant
 
imageWidth
PIC 9(n)
Specifies the width in pixels of the bitmap frame. The function generates a frame for each character in the characters sequence and then combines all the frames into a bitmap strip. Regardless of the font size, characters will be resized to fit the width specified by this parameter.
WBITMAP-LSF-DATA
Group Item
Structure that hosts the information. This group item, defined in isgui.def, has the following structure:
 
01 wbitmap-lsf-data.
 03 wbitmap-lsf-element     occurs dynamic.
  05 wbitmap-lsf-font       handle of font.
  05 wbitmap-lsf-characters pic n any length.
  05 wbitmap-lsf-color      pic s9(18comp-4.
 
wbitmap-lsf-font
A font handle as returned by the W$FONT routine or one of the internal fonts available in the runtime (e.g. SMALL-FONT).
 
wbitmap-lsf-characters
Specifies the list of characters that will be included in the bitmap strip. Use a national data item or literal if the font requires Unicode representation of the characters.
 
wbitmap-lsf-color
Specifies the color of the characters. A negative value is treated as RGB color while a positive value is treated as COBOL color. See Color management for more information. If not set, then the black color is used.
Return code:
bitmapHandle must be declared as PIC S9(9) COMP-4 and provides additional information:
> 0
Receives the handle to the bitmap
0
An error occurred, probably the font handle is invalid or an empty string of characters was passed