DosPFSInit

This call allows the Font Switcher to initialize code page and font switching for a specified printer.

Syntax
DosPFSInit (CPHdw, FontFileName, PrinterType, PrinterName, Instances, Reserved)

Parameters

 * CPHdw (PUSHORT) - input : Address of the pointer list, in the following format, that specifies the hardware code page and fonts on the printer.
 * 0 - Number of definitions that follow. DWord 1/N - Code page number (1st Word of DWord) and Font ID (2nd Word of DWord) for each hardware font in order corresponding to the hardware code page and font selection numbers. (For example, the first code page and font ID value corresponds to the default hardware font 0, the second, to hardware font 1, the third, to hardware font 2, and so on. If the default hardware font is not known, 0 should be specified for the default code page and font).


 * FontFileName (PSZ) - input : Address of the pathname of the font file of the specified printer that initiates the code page and font switching.
 * PrinterType (PSZ) - input : Address of the printer type ID.
 * PrinterName (PSZ) - input : Address of the name of the printer that initiates code page and font switching.
 * Instances (USHORT) - input : Maximum number of different instances of use tracking code page and font switching. This value is advisory for the Font Switcher allocating enough resources for the specified number of instances being tracked.
 * Reserved (ULONG) - input : Reserved must be set to zero.

Return Code

 * rc (USHORT) - return:Return values are:
 * Code page switcher already initialized
 * User entered too many ROMs in DEVINFO, initialization continued with the rest
 * Wrong or missing font file ID
 * Code page switcher internal error
 * 10 Invalid printer name as input
 * 11 Printer type input does not match that in font file
 * 12 Could not get storage for control blocks
 * 14 Could not open font file during initialization
 * 17 Switcher reports too many system file number entries
 * 19 I/O error reading font file control sequence section
 * 20 I/O error reading font file header
 * 21 I/O error reading font file font definition block
 * 22 Some fonts bad due to error in font file, initialization continued.

Remarks
DosPFSInit is intended for use only by applications that replace the spooler as a print monitor and that do code page switching. Other applications should use printer IOCTLs to manipulate printer code page switching.

DosPFSInit is located in SPOOLCP.DLL (not DOSCALLS.LIB) and requires an import statement in the module definition file. Refer to the IBM Operating System/2 Version 1.2 Building Programs, Module Definition File Statements section for information regarding the import statement.

C

 * 1) define INCL_DOSPFS

USHORT rc = DosPFSInit(CPHdw, FontFileName, PrinterType, PrinterName,                             Instances, Reserved);

PUSHORT CPHdw;         /* Hdw Font definition list */ PSZ     FontFileName;  /* File pathname of the font file to use */ PSZ     PrinterType;   /* Printer type string */ PSZ     PrinterName;   /* Printer name string */ USHORT  Instances;     /* Number of spool instances */ ULONG   0;             /* Reserved */

USHORT  rc;            /* return code */ 

MASM
 EXTRN DosPFSInit:FAR INCL_DOSPFS        EQU 1

PUSH@ WORD    CPHdw         ;Hdw Font definition list PUSH@ ASCIIZ  FontFileName  ;File pathname of the font file to use PUSH@ ASCIIZ  PrinterType   ;Printer type string PUSH@ ASCIIZ  PrinterName   ;Printer name string PUSH  WORD    Instances     ;Number of spool instances PUSH  DWORD   0             ;Reserved (must be zero) CALL  DosPFSInit

Returns WORD 