Jump to content

GreQueryFonts: Difference between revisions

From EDM2
Created page with "GreQueryFonts returns the details of fonts that match the face name addressed by pszFaceName. This function is supported by the graphics engine. == Syntax == GreQueryFon..."
 
Ak120 (talk | contribs)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
GreQueryFonts returns the details of fonts that match the face name addressed by pszFaceName.  
GreQueryFonts returns the details of fonts that match the face name addressed by pszFaceName.


This function is supported by the graphics engine.  
This function is supported by the graphics engine.


== Syntax ==  
== Syntax ==  
  GreQueryFonts(hdc, flOptions, pszFaceName, paMetrics, cMetricLen, pcFontCount, pInstance, lFunction);
  GreQueryFonts(hdc, flOptions, pszFaceName, paMetrics, cMetricLen, pcFontCount,
              pInstance, lFunction)


== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;flOptions (ULONG) - input:Flags indicating whether private fonts, public fonts, or both are required.
 
:These flags can be used in combination:
;flOptions (ULONG) - input  
:*QFF_PUBLIC Enumerate public fonts
:Flags indicating whether private fonts, public fonts, or both are required.  
:*QFF_PRIVATE Enumerate private fonts
 
;pszFaceName (PSZ) - input:Pointer to a string specifying the face name.
:These flags can be used in combination:  
:When this is NULL, all faces are matched.
 
;paMetrics (PFONTMETRICS) - input:Pointer to an array of font element records to which the metrics of matching fonts are returned. This is a pointer to an array of up to cFontCount font metric records, each of which contains a maximum of cMetricLen bytes. Note that for multi-codepage fonts the usCodePage field has no meaning and is set to 0.
:*QFF_PUBLIC Enumerate public fonts  
;cMetricLen (ULONG) - input:Length in bytes of each metrics structure in the paMetrics array.
:*QFF_PRIVATE Enumerate private fonts  
;pcFontCount (PULONG) - input:Pointer to cFontCount that specifies the number of fonts for which metrics are required. On return, this is updated to the number of fonts for which metrics were returned.
 
;pInstance (PVOID) - input:Pointer to instance data.
;pszFaceName (PSZ) - input  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreQueryFonts.
:Pointer to a string specifying the face name.  
 
:When this is NULL, all faces are matched.  
 
;paMetrics (PFONTMETRICS) - input  
:Pointer to an array of font element records to which the metrics of matching fonts are returned. This is a pointer to an array of up to cFontCount font metric records, each of which contains a maximum of cMetricLen bytes. Note that for multi-codepage fonts the usCodePage field has no meaning and is set to 0.  
 
;cMetricLen (ULONG) - input  
:Length in bytes of each metrics structure in the paMetrics array.  
 
;pcFontCount (PULONG) - input  
:Pointer to cFontCount that specifies the number of fonts for which metrics are required. On return, this is updated to the number of fonts for which metrics were returned.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreQueryFonts.  


== Returns ==
== Returns ==
;rc (LONG) - returns  
;rc (LONG) - 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_COORDINATE_OVERFLOW
:*PMERR_DEV_FUNC_NOT_INSTALLED
:*PMERR_HDC_BUSY
:*PMERR_INV_COORD_SPACE
:*PMERR_INV_HDC
:*PMERR_INV_LENGTH_OR_COUNT
:*PMERR_INV_OR_INCOMPAT_OPTIONS


:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.  
;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_COORDINATE_OVERFLOW
:*PMERR_DEV_FUNC_NOT_INSTALLED
:*PMERR_HDC_BUSY
:*PMERR_INV_COORD_SPACE
:*PMERR_INV_HDC
:*PMERR_INV_LENGTH_OR_COUNT
:*PMERR_INV_OR_INCOMPAT_OPTIONS
:Refer to the "Error Explanations" section of the ''Presentation Manager Programming Reference'' for further explanation.


== Sample ==
== Sample ==
Line 61: Line 40:
#include <os2.h>
#include <os2.h>


HDC             hdc;          /*  Device context handle. */
HDC           hdc;          /*  Device context handle. */
ULONG           flOptions;    /*  Flags indicating whether private fonts, public fonts, or both are required. */
ULONG         flOptions;    /*  Flags indicating whether private fonts, public fonts, or both are required. */
PSZ             pszFaceName;  /*  Pointer to a string specifying the face name. */
PSZ           pszFaceName;  /*  Pointer to a string specifying the face name. */
PFONTMETRICS   paMetrics;
PFONTMETRICS paMetrics;
ULONG           cMetricLen;  /*  Length in bytes of each metrics structure in the paMetrics array. */
ULONG         cMetricLen;  /*  Length in bytes of each metrics structure in the paMetrics array. */
PULONG         pcFontCount;
PULONG       pcFontCount;
PVOID           pInstance;    /*  Pointer to instance data. */
PVOID         pInstance;    /*  Pointer to instance data. */
ULONG           lFunction;    /*  High-order WORD=flags; low-order WORD=NGreQueryFonts. */
ULONG         lFunction;    /*  High-order WORD=flags; low-order WORD=NGreQueryFonts. */
LONG           rc;          /*  Return codes. */
LONG         rc;          /*  Return codes. */


rc = GreQueryFonts(hdc, flOptions, pszFaceName,
rc = GreQueryFonts(hdc, flOptions, pszFaceName, paMetrics, cMetricLen, pcFontCount,
      paMetrics, cMetricLen, pcFontCount,
       pInstance, lFunction);
       pInstance, lFunction);
</pre>
</pre>


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

Latest revision as of 23:31, 24 March 2020

GreQueryFonts returns the details of fonts that match the face name addressed by pszFaceName.

This function is supported by the graphics engine.

Syntax

GreQueryFonts(hdc, flOptions, pszFaceName, paMetrics, cMetricLen, pcFontCount,
              pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
flOptions (ULONG) - input
Flags indicating whether private fonts, public fonts, or both are required.
These flags can be used in combination:
  • QFF_PUBLIC Enumerate public fonts
  • QFF_PRIVATE Enumerate private fonts
pszFaceName (PSZ) - input
Pointer to a string specifying the face name.
When this is NULL, all faces are matched.
paMetrics (PFONTMETRICS) - input
Pointer to an array of font element records to which the metrics of matching fonts are returned. This is a pointer to an array of up to cFontCount font metric records, each of which contains a maximum of cMetricLen bytes. Note that for multi-codepage fonts the usCodePage field has no meaning and is set to 0.
cMetricLen (ULONG) - input
Length in bytes of each metrics structure in the paMetrics array.
pcFontCount (PULONG) - input
Pointer to cFontCount that specifies the number of fonts for which metrics are required. On return, this is updated to the number of fonts for which metrics were returned.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreQueryFonts.

Returns

rc (LONG) - 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_COORDINATE_OVERFLOW
  • PMERR_DEV_FUNC_NOT_INSTALLED
  • PMERR_HDC_BUSY
  • PMERR_INV_COORD_SPACE
  • PMERR_INV_HDC
  • PMERR_INV_LENGTH_OR_COUNT
  • PMERR_INV_OR_INCOMPAT_OPTIONS
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. */
ULONG         flOptions;    /*  Flags indicating whether private fonts, public fonts, or both are required. */
PSZ           pszFaceName;  /*  Pointer to a string specifying the face name. */
PFONTMETRICS  paMetrics;
ULONG         cMetricLen;   /*  Length in bytes of each metrics structure in the paMetrics array. */
PULONG        pcFontCount;
PVOID         pInstance;    /*  Pointer to instance data. */
ULONG         lFunction;    /*  High-order WORD=flags; low-order WORD=NGreQueryFonts. */
LONG          rc;           /*  Return codes. */

rc = GreQueryFonts(hdc, flOptions, pszFaceName, paMetrics, cMetricLen, pcFontCount,
       pInstance, lFunction);