Difference between revisions of "GreQueryFontFileDescriptions"

From EDM2
Jump to: navigation, search
(Created page with "GreQueryFontFileDescriptions determines whether a file is a font file and, if so, returns the family and face names for the fonts in the file. This function is supported by ...")
 
m
 
Line 1: Line 1:
GreQueryFontFileDescriptions determines whether a file is a font file and, if so, returns the family and face names for the fonts in the file.  
+
GreQueryFontFileDescriptions determines whether a file is a font file and, if so, returns the family and face names for the fonts in the file.
  
This function is supported by the graphics engine.  
+
This function is supported by the graphics engine.
  
 
== Syntax ==  
 
== Syntax ==  
  GreQueryFontFileDescriptions(hdc, pszFileName, pcFonts, paszNames, pInstance, lFunction);
+
  GreQueryFontFileDescriptions(hdc, pszFileName, pcFonts, paszNames, pInstance, lFunction)
  
 
== Parameters ==
 
== Parameters ==
;hdc (HDC) - input  
+
;hdc (HDC) - input:Device context handle.
:Device context handle.  
+
;pszFileName (PSZ) - input:Pointer to the file path and name of the font file.
 
+
;pcFonts (PULONG) - input:Pointer to a count of the maximum number of family and face name pairs to be returned. On completion, this count is updated to the number of pairs actually returned.
;pszFileName (PSZ) - input  
+
;paszNames (PSZ) - input:Pointer to an array of family and face name pairs whose size is 2 x pcFonts. The family name is the first in each pair.
:Pointer to the file path and name of the font file.  
+
;pInstance (PVOID) - input:Pointer to instance data.
 
+
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreQueryFontFileDescriptions.
;pcFonts (PULONG) - input  
+
:Pointer.
+
 
+
:Pointer to a count of the maximum number of family and face name pairs to be returned. On completion, this count is updated to the number of pairs actually returned.  
+
 
+
;paszNames (PSZ) - input  
+
:Pointer.
+
 
+
:Pointer to an array of family and face name pairs whose size is 2 x pcFonts. The family name is the first in each pair.  
+
 
+
;pInstance (PVOID) - input  
+
:Pointer to instance data.  
+
 
+
;lFunction (ULONG) - input  
+
:High-order WORD=flags; low-order WORD=NGreQueryFontFileDescriptions.  
+
  
 
== Returns ==
 
== Returns ==
;rc (ULONG) - returns  
+
;rc (ULONG) - returns:Return codes.
:Return codes.  
+
:This function returns the number of fonts not returned, or it returns GPI_ALTERROR if an error occurs.
  
:This function returns the number of fonts not returned, or it returns GPI_ALTERROR if an error occurs.
+
;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
;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_INV_FONT_FILE_DATA
 
+
:Refer to the "Error Explanations" section of the ''Presentation Manager Programming Reference'' for further explanation.
:*PMERR_BASE_ERROR  
+
:*PMERR_INV_FONT_FILE_DATA  
+
 
+
:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.  
+
  
 
== Sample ==
 
== Sample ==
Line 52: Line 33:
 
PSZ      paszNames;    /*  Pointer. */
 
PSZ      paszNames;    /*  Pointer. */
 
PVOID    pInstance;    /*  Pointer to instance data. */
 
PVOID    pInstance;    /*  Pointer to instance data. */
ULONG    lFunction;    /*  High-order WORD=flags; low-order WORD=NGreQueryFontFileDescriptions.  
+
ULONG    lFunction;    /*  High-order WORD=flags; low-order WORD=NGreQueryFontFileDescriptions. */
 
+
*/
+
 
ULONG    rc;          /*  Return codes. */
 
ULONG    rc;          /*  Return codes. */
  
Line 62: Line 41:
  
 
== Remarks ==
 
== Remarks ==
The names are returned at the location addressed by paszNames. Typically, the calling routine calls GreQueryFontFileDescriptions twice. The first call sets pcFonts to 0 and determines the number of fonts in the file. When sufficient storage is allocated for the names, GreQueryFontFileDescriptions is called again with pcFonts pointing to the font count.  
+
The names are returned at the location addressed by paszNames. Typically, the calling routine calls GreQueryFontFileDescriptions twice. The first call sets pcFonts to 0 and determines the number of fonts in the file. When sufficient storage is allocated for the names, GreQueryFontFileDescriptions is called again with pcFonts pointing to the font count.
  
 
[[Category:Gre]]
 
[[Category:Gre]]

Latest revision as of 21:28, 24 March 2020

GreQueryFontFileDescriptions determines whether a file is a font file and, if so, returns the family and face names for the fonts in the file.

This function is supported by the graphics engine.

Syntax

GreQueryFontFileDescriptions(hdc, pszFileName, pcFonts, paszNames, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
pszFileName (PSZ) - input
Pointer to the file path and name of the font file.
pcFonts (PULONG) - input
Pointer to a count of the maximum number of family and face name pairs to be returned. On completion, this count is updated to the number of pairs actually returned.
paszNames (PSZ) - input
Pointer to an array of family and face name pairs whose size is 2 x pcFonts. The family name is the first in each pair.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreQueryFontFileDescriptions.

Returns

rc (ULONG) - returns
Return codes.
This function returns the number of fonts not returned, or it returns GPI_ALTERROR if an error occurs.
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_INV_FONT_FILE_DATA
Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.

Sample

#define INCL_GRE_FONTS
#include <os2.h>

HDC       hdc;          /*  Device context handle. */
PSZ       pszFileName;  /*  Pointer to the file path and name of the font file. */
PULONG    pcFonts;      /*  Pointer. */
PSZ       paszNames;    /*  Pointer. */
PVOID     pInstance;    /*  Pointer to instance data. */
ULONG     lFunction;    /*  High-order WORD=flags; low-order WORD=NGreQueryFontFileDescriptions. */
ULONG     rc;           /*  Return codes. */

rc = GreQueryFontFileDescriptions(hdc, pszFileName,
       pcFonts, paszNames, pInstance, lFunction);

Remarks

The names are returned at the location addressed by paszNames. Typically, the calling routine calls GreQueryFontFileDescriptions twice. The first call sets pcFonts to 0 and determines the number of fonts in the file. When sufficient storage is allocated for the names, GreQueryFontFileDescriptions is called again with pcFonts pointing to the font count.