Jump to content

VioGetFont: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call returns either the font table of the size specified or the font in use.
This call returns either the font table of the size specified or the font in use.
==Syntax==
==Syntax==
<PRE>
  VioGetFont (RequestBlock, VioHandle)
  VioGetFont
 
    (RequestBlock, VioHandle)
</PRE>
==Parameters==
; RequestBlock (PVIOFONTINFO) - input/output : Address of the font structure that returns current RAM font or specified ROM or code page font depending on the request type:


length (USHORT) Length of structure, including length.
===Parameters===
;RequestBlock (P[[VIOFONTINFO]]) - input/output: Address of the font structure that returns current RAM font or specified ROM or code page font depending on the request type.
;VioHandle ([[HVIO]]) - input : Reserved word of 0s.


14          Only valid value.
reqtype (USHORT)
            Request type:
            Value
                Definition
0
                Get current RAM font for EGA, VGA, or IBM Personal System/2 Display Adapter.
1
                Get ROM font for CGA, EGA, VGA, or IBM Personal System/2 Display Adapter.
pelcolumns (USHORT)
                Pel columns in character cell.
 
pelrows (USHORT)
                Pel rows in character cell.
fonttable (PVOID)
                Address of the requested font table returned in a caller-supplied data area. If the storage area is accessed by way of an address of 0, a system-supplied segment containing the requested font table is returned.
  tablelength (USHORT)
                Length, in bytes, of the caller-supplied data area where the font table is returned.
; VioHandle (HVIO) - input : Reserved word of 0s.
==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
*0 NO_ERROR
*355 ERROR_VIO_MODE
*421 ERROR_VIO_INVALID_PARMS
*438 ERROR_VIO_INVALID_LENGTH
*465 ERROR_VIO_DETACHED
*467 ERROR_VIO_FONT
*494 ERROR_VIO_EXTENDED_SG


Return code descriptions are:
* 0    NO_ERROR
* 355        ERROR_VIO_MODE
* 421        ERROR_VIO_INVALID_PARMS
* 438        ERROR_VIO_INVALID_LENGTH
* 465        ERROR_VIO_DETACHED
* 467        ERROR_VIO_FONT
* 494        ERROR_VIO_EXTENDED_SG
==Remarks==
==Remarks==
For reqtype = 1, return ROM font, the font size requested must be supported by the display adapter installed. The 8x8, 8x14, 9x14, 8x16, or 9x16 character font may be requested for the VGA or PS/2 Display Adapters. The 8x8, 8x14, or 9x14 font may be requested for the enhanced graphics adapter. The 8x8 font may be requested for the color graphics adapter.
For reqtype = 1, return ROM font, the font size requested must be supported by the display adapter installed. The 8x8, 8x14, 9x14, 8x16, or 9x16 character font may be requested for the VGA or PS/2 Display Adapters. The 8x8, 8x14, or 9x14 font may be requested for the enhanced graphics adapter. The 8x8 font may be requested for the colour graphics adapter.


Note: Although graphics mode support is provided in VioGetFont, this support is not provided by the Base Video Handlers provided with OS/2.
Note: Although graphics mode support is provided in VioGetFont, this support is not provided by the Base Video Handlers provided with OS/2.
Line 55: Line 25:
For reqtype = 1, return ROM font, the far address returned is a ROM pointer only for those fonts where the font table for the full 256-character set is actually contained in ROM. Otherwise, the far address returned is a RAM pointer. Note that for 8x8 on the CGA, the font table for the full 256-character set is returned. For 9x14 or 9x16 the font table for the full 256-character set is also returned. Partial fonts are not returned. The 9x14 and 9x16 fonts are derived from variations of the 8x14 and 8x16 fonts, respectively, where the definitions of fonts for those characters that are different, are replaced.
For reqtype = 1, return ROM font, the far address returned is a ROM pointer only for those fonts where the font table for the full 256-character set is actually contained in ROM. Otherwise, the far address returned is a RAM pointer. Note that for 8x8 on the CGA, the font table for the full 256-character set is returned. For 9x14 or 9x16 the font table for the full 256-character set is also returned. Partial fonts are not returned. The 9x14 and 9x16 fonts are derived from variations of the 8x14 and 8x16 fonts, respectively, where the definitions of fonts for those characters that are different, are replaced.


For VioGetFont specifying reqtype = 1, return ROM font, the font returned is derived from the fonts contained in the system, EGA, VGA, and PS/2 Display Adapter BIOS data areas as applicable. There is an exception for the EGA, VGA and PS/2 Display Adapter when VioSetCp or VioSetFont has been issued. In that case, the font of the size requested is returned from the active code page or the list of user fonts already set.  
For VioGetFont specifying reqtype = 1, return ROM font, the font returned is derived from the fonts contained in the system, EGA, VGA, and PS/2 Display Adapter BIOS data areas as applicable. There is an exception for the EGA, VGA and PS/2 Display Adapter when [[VioSetCp]] or [[VioSetFont]] has been issued. In that case, the font of the size requested is returned from the active code page or the list of user fonts already set.


==Example Code==
==Bindings==
=== C Binding===
===C===
<PRE>
<PRE>
typedef struct _VIOFONTINFO {   /* viofi */
typedef struct _VIOFONTINFO { /* viofi */
   USHORT  cb;                /* length of this structure */
   USHORT  cb;                /* length of this structure */
   USHORT  type;              /* request type */
   USHORT  type;              /* request type */
Line 66: Line 36:
   USHORT  cyCell;            /* pel rows in character cell */
   USHORT  cyCell;            /* pel rows in character cell */
   PVOID  pbData;            /* requested font table (returned) */
   PVOID  pbData;            /* requested font table (returned) */
   USHORT  cbData;            /* length of caller supplied data area
   USHORT  cbData;            /* length of caller supplied data area (in bytes) */
                                (in bytes) */
} VIOFONTINFO;
} VIOFONTINFO;


Line 80: Line 49:
</PRE>
</PRE>


=== MASM Biding ===
===MASM===
 
<PRE>
<PRE>
VIOFONTINFO struc
VIOFONTINFO struc
Line 101: Line 69:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Vio]]

Latest revision as of 21:41, 1 January 2020

This call returns either the font table of the size specified or the font in use.

Syntax

VioGetFont (RequestBlock, VioHandle)

Parameters

RequestBlock (PVIOFONTINFO) - input/output
Address of the font structure that returns current RAM font or specified ROM or code page font depending on the request type.
VioHandle (HVIO) - input
Reserved word of 0s.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 355 ERROR_VIO_MODE
  • 421 ERROR_VIO_INVALID_PARMS
  • 438 ERROR_VIO_INVALID_LENGTH
  • 465 ERROR_VIO_DETACHED
  • 467 ERROR_VIO_FONT
  • 494 ERROR_VIO_EXTENDED_SG

Remarks

For reqtype = 1, return ROM font, the font size requested must be supported by the display adapter installed. The 8x8, 8x14, 9x14, 8x16, or 9x16 character font may be requested for the VGA or PS/2 Display Adapters. The 8x8, 8x14, or 9x14 font may be requested for the enhanced graphics adapter. The 8x8 font may be requested for the colour graphics adapter.

Note: Although graphics mode support is provided in VioGetFont, this support is not provided by the Base Video Handlers provided with OS/2.

For reqtype = 1, return ROM font, the far address returned is a ROM pointer only for those fonts where the font table for the full 256-character set is actually contained in ROM. Otherwise, the far address returned is a RAM pointer. Note that for 8x8 on the CGA, the font table for the full 256-character set is returned. For 9x14 or 9x16 the font table for the full 256-character set is also returned. Partial fonts are not returned. The 9x14 and 9x16 fonts are derived from variations of the 8x14 and 8x16 fonts, respectively, where the definitions of fonts for those characters that are different, are replaced.

For VioGetFont specifying reqtype = 1, return ROM font, the font returned is derived from the fonts contained in the system, EGA, VGA, and PS/2 Display Adapter BIOS data areas as applicable. There is an exception for the EGA, VGA and PS/2 Display Adapter when VioSetCp or VioSetFont has been issued. In that case, the font of the size requested is returned from the active code page or the list of user fonts already set.

Bindings

C

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 = VioGetFont(RequestBlock, VioHandle);

PVIOFONTINFO     RequestBlock;  /* Request block */
HVIO             VioHandle;     /* Vio handle */

USHORT           rc;            /* return code */

MASM

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  VioGetFont:FAR
INCL_VIO            EQU 1

PUSH@  OTHER   RequestBlock  ;Request block
PUSH   WORD    VioHandle     ;Vio handle
CALL   VioGetFont

Returns WORD