Jump to content

GreLoadFont

From EDM2
Revision as of 03:16, 2 January 2020 by Martini (talk | contribs) (Created page with "This function loads fonts from a resource file. All fonts in the file are private and are only available to the process that called this function. This function is supported...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function loads fonts from a resource file. All fonts in the file are private and are only available to the process that called this function.

This function is supported by the graphics engine.

Syntax

 GreLoadFont(pszFilename, pInstance, lFunction);

Parameters

pszFilename (PSZ) - input
Pointer.
Pointer to a NULL-terminated string containing path and name of the font file, identified by the file extension FON.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreLoadFont.

Return Code

fSuccess (BOOL) - returns
Return codes.
On completion, the handling routine must return BOOLEAN (fSuccess).
  • TRUE Successful
  • FALSE Error
Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:
  • PMERR_BASE_ERROR
  • PMERR_INSUFFICIENT_MEMORY
  • PMERR_INV_FONT_FILE_DATA
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Sample Code

#define INCL_GRE_FONTS
#include <os2.h>

PSZ      pszFilename;  /*  Pointer. */
PVOID    pInstance;    /*  Pointer to instance data. */
ULONG    lFunction;    /*  High-order WORD=flags; low-order WORD=NGreLoadFont. */
BOOL     fSuccess;     /*  Return codes. */

fSuccess = GreLoadFont(pszFilename, pInstance, lFunction);