GetKerningPairs

3.1

  int GetKerningPairs(hdc, cPairs, lpkrnpair)    
  HDC hdc; /* handle of device context */
  int cPairs; /* number of kerning pairs */
  KERNINGPAIR FAR* lpkrnpair; /* pointer to structures for kerning pairs */

The GetKerningPairs function retrieves the character kerning pairs for the font that is currently selected in the specified device context.

Parameters

hdc

Identifies a device context. The GetKerningPairs function retrieves kerning pairs for the current font for this device context.

cPairs

Specifies the number of KERNINGPAIR structures pointed to by the lpkrnpair parameter. The function will not copy more kerning pairs than specified by cPairs.

The KERNINGPAIR structure has the following form:

typedef struct tagKERNINGPAIR {
    WORD wFirst;
    WORD wSecond;
    int  iKernAmount;
} KERNINGPAIR;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

lpkrnpair

Points to an array of KERNINGPAIR structures that receive the kerning pairs when the function returns. This array must contain at least as many structures as specified by the cPairs parameter. If this parameter is NULL, the function returns the total number of kerning pairs for the font.

Return Value

The return value specifies the number of kerning pairs retrieved or the total number of kerning pairs in the font, if the function is successful. It is zero if the function fails or there are no kerning pairs for the font.