GpiQueryKerningPairs
Appearance
This function returns kerning pair information for the logical font identified by the current value of the character set attribute.
Syntax
GpiQueryKerningPairs(hps, lCount, akrnprData)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- lCount (LONG) - input
- Number of elements in akrnprData.
- akrnprData (PKERNINGPAIRS) - output
- Kerning pairs.
- An array of lCount kerning pairs in which information is returned. No more than lCount records are returned.
Returns
- lReturned (LONG) - returns
- Number returned and error indicators.
- >=0
- Number of kerning pairs returned
- GPI_ALTERROR
- Error.
Errors
Possible returns from WinGetLastError
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_PS_BUSY (0x20F4)
- An attempt was made to access the presentation space from more than one thread simultaneously.
- PMERR_INV_LENGTH_OR_COUNT (0x2092)
- An invalid length or count parameter was specified.
- PMERR_COORDINATE_OVERFLOW (0x2014)
- An internal coordinate overflow error occurred. This can occur if coordinates or matrix transformation elements (or both) are invalid or too large.
Remarks
The number of kerned pairs is a field in the font metrics.
Example Code
#define INCL_GPILCIDS /* Or use INCL_GPI, INCL_PM, */ #include <os2.h> HPS hps; /* Presentation-space handle. */ LONG lCount; /* Number of elements in akrnprData. */ PKERNINGPAIRS akrnprData; /* Kerning pairs. */ LONG lReturned; /* Number returned and error indicators. */ lReturned = GpiQueryKerningPairs(hps, lCount, akrnprData);
This example uses the GpiQueryKerningPairs function to retrieve the kerning information for the current font.
#define INCL_GPILCIDS /* Font functions */ #define INCL_DOSMEMMGR /* DOS Memory Manager Functions */ #include <os2.h> HPS hps; /* presentation space handle */ FONTMETRICS fm; /* metrics structure */ PKERNINGPAIRS akrnpr; /* kerning pairs array */ GpiQueryFontMetrics(hps, (LONG) sizeof(FONTMETRICS), &fm); DosAllocMem((VOID *)akrnpr, (ULONG)(fm.sKerningPairs * sizeof(KERNINGPAIRS)), PAG_COMMIT | PAG_READ | PAG_WRITE); GpiQueryKerningPairs(hps, (LONG) fm.sKerningPairs, akrnpr);