subcalls.hlp (Topic list)
VioGetFont (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_VIO
 
USHORT VioGetFont(pviofi, hvio)
PVIOFONTINFO pviofi;    /* pointer to structure for font information */
HVIO hvio;              /* video handle                              */
 
The VioGetFont function retrieves a specified font. A font consists of one
bitmap for each character in a character set. The bitmaps define the
character shapes. The VioGetFont function retrieves a copy of either the
current font or a font from the ROM of the video display adapter.
 
The VioGetFont function is a family API function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
pviofi     Points to the VIOFONTINFO structure that specifies the request
           type and receives the font information.
 
hvio       Identifies an advanced video-input-and-output (AVIO) presentation
           space. For AVIO programs, this handle must have been created
           previously using the VioCreatePS function. For other programs,
           hvio must be NULL.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_VIO_COL
     ERROR_VIO_FONT
     ERROR_VIO_INVALID_PARMS
     ERROR_VIO_ROW
 
Comments
 
Although the VioGetFont function can retrieve fonts for many display
adapters, the fonts for some adapters are not available. In most cases, the
function retrieves a full 256-character font. This font may consist of a
complete ROM font, or it may be derived from downloaded fonts that are saved
in the adapter's BIOS. The current font is defined by the most recent
DosSetCp or VioSetCp function, or it can be set by using the VioSetFont
function.
 
Example
 
This example calls the VioGetFont function to obtain the current font. When
it returns, the cxCell and cyCell fields will contain the dimensions (in
points) of a character cell. The pbData field points to the font:
 
VIOFONTINFO viofiFont;
viofiFont.cb = sizeof(viofiFont);      /* length of structure    */
viofiFont.type = VGFI_GETCURFONT;      /* retrieves current font */
viofiFont.cxCell = 0;                  /* clears columns         */
viofiFont.cyCell = 0;                  /* clears rows            */
viofiFont.pbData = 0L;                 /* address of data area   */
viofiFont.cbData = 0;                  /* length of data area    */
VioGetFont(&viofiFont, 0);
 
See Also
 
DosSetCp, VioCreatePS, VioSetCp, VioSetFont, VIOFONTINFO