gpi12.hlp (Table of Contents; Topic list)
GpiQueryWidthTable (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPILCIDS
 
BOOL GpiQueryWidthTable(hps, lFirstChar, clWidths, alWidths)
HPS hps;            /* presentation-space handle        */
LONG lFirstChar;    /* code point of first character    */
LONG clWidths;      /* number of elements               */
PLONG alWidths;     /* address of array for width table */
 
The GpiQueryWidthTable function retrieves the widths of one or more
characters in the current font. A character width is the distance (in world
coordinates) the system advances along the baseline after drawing the
character. The function copies the widths, starting with the width for the
character specified by the lFirstChar parameter, to the array pointed to by
the alWidths parameter. The function uses the clWidths parameter to
determine how many widths to retrieve.
 
If the widths for all characters in the font are desired, the
GpiQueryFontMetrics function can be used to retrieve the number of
characters in the font.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
hps         Identifies the presentation space.
 
lFirstChar  Specifies the code point of the first character for which a
            width is retrieved.
 
clWidths    Specifies the number of widths to retrieve.
 
alWidths    Points to the array that receives the character widths. The
            array must have the number of elements specified by clWidths.
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INV_FIRST_CHAR
     PMERR_INV_HPS
     PMERR_INV_LENGTH_OR_COUNT
     PMERR_PS_BUSY
 
See Also
 
GpiQueryFontMetrics, WinGetLastError