Jump to content

GreLoadFont: Difference between revisions

From EDM2
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..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
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 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.  
This function is supported by the graphics engine.


==Syntax==
==Syntax==
  GreLoadFont(pszFilename, pInstance, lFunction);
GreLoadFont(pszFilename, pInstance, lFunction)
 
==Parameters==
==Parameters==
;pszFilename (PSZ) - input  
;pszFilename (PSZ) - input:Pointer to a NULL-terminated string containing path and name of the font file, identified by the file extension FON.
:Pointer.
;pInstance (PVOID) - input:Pointer to instance data.
 
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreLoadFont.
: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==
==Return Code==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:On completion, the handling routine must return BOOLEAN (fSuccess).
 
:*TRUE Successful
:On completion, the handling routine must return BOOLEAN (fSuccess).  
:*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:
:*TRUE Successful  
:*PMERR_BASE_ERROR
:*FALSE Error  
:*PMERR_INSUFFICIENT_MEMORY
 
:*PMERR_INV_FONT_FILE_DATA
:Possible Errors Detected:   When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:  
Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
 
:*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==
<PRE>
#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);
 
</PRE>


[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 21:21, 27 February 2020

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 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.