This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS
Note: This is legacy API call. It is recommended to use 32-bit equivalent
This call downloads a display font. The font being set must be compatible with the current mode.
VioSetFont (RequestBlock, VioHandle)
rc (USHORT) - return:Return code descriptions are:
VioSetFont is applicable only for the enhanced graphics adapter, VGA or IBM Personal System/2 Display Adapter.
Note: Although graphics mode support is provided in VioSetFont, this support is not provided by the Base Video Handlers provided with OS/2.
When VioSetFont is issued, the current code page is reset. If VioGetCp is subsequently issued, the error code ERROR_VIO_USER_FONT is returned. Return code, ERROR_VIO_USER_FONT represents a warning. It indicates that although the font could not be loaded into the adapter using the current mode, the font was saved as part of a special user font code page for use with a later VioSetMode. Successfully setting a user font sets the special user font code page, just as if a code page of -1 was specified using VioSetCp.
The user font code page consists of the most recent user font of each size that was set by VioSetFont. For example, if two 8×12 fonts and three 8×16 fonts had been set, only two fonts, the most recent of the 8×12 and 8×16 fonts, would be saved.
The special code page is used in the same way as those code pages specified on the CODEPAGE = statement in CONFIG.SYS.
typedef struct _VIOFONTINFO{ /* viofi */ USHORT cb; /* length of this structure */ USHORT type; /* request type */ USHORT cxCell; /* pel columns in character cell */ USHORT cyCell; /* pel rows in character cell */ PVOID pbData; /* requested font table (returned) */ USHORT cbData; /* length of caller supplied data area (in bytes) */ } VIOFONTINFO; #define INCL_VIO USHORT rc = VioSetFont(RequestBlock, VioHandle); PVIOFONTINFO RequestBlock; /* Request block */ HVIO VioHandle; /* Video handle */ USHORT rc; /* return code */
VIOFONTINFO struc viofi_cb dw ? ;length of this structure viofi_type dw ? ;request type viofi_cxCell dw ? ;pel columns in character cell viofi_cyCell dw ? ;pel rows in character cell viofi_pbData dd ? ;requested font table (returned) viofi_cbData dw ? ;length of caller supplied data area (in bytes) VIOFONTINFO ends EXTRN VioSetFont:FAR INCL_VIO EQU 1 PUSH@ OTHER RequestBlock ;Request block PUSH WORD VioHandle ;Video handle CALL VioSetFont Returns WORD