short Escape(hDC, GETPAIRKERNTABLE, NULL, NULL,lpOutData)
This escape fills the buffer pointed to by the lpOutData parameter with the character-pair kerning table for the selected font.
Parameter | Type/Description |
hDC | HDC Identifies the device context. | |
lpOutData | KERNPAIR FAR * Points to an array of KERNPAIR data structures. This array must be large enough to accommodate the font's entire character-pair kerning table. The number of character-kerning pairs in the font can be obtained from the EXTTEXTMETRIC data structure returned by the GETEXTENDEDTEXTMETRICS escape. See the following “Comments” section for the format of the KERNPAIR data structure. |
The return value specifies the number of KERNPAIR structures copied to the buffer. This value is zero if the font does not have kerning pairs defined, the escape fails, or is not implemented.
The KERNPAIR data structure has the following format:
typedef struc {
union {
BYTE each [2]; /* UNION: 'each' and 'both'
share the same memory */
WORD both;
} kpPair;
short kpKernAmount;
} KERNPAIR;
The KERNPAIR structure contains the following fields:
Field | Description |
kpPair.each[0] | Specifies the character code for the first character in the kerning pair. |
kpPair.each[1] | Specifies the character code for the second character in the kerning pair. |
kpPair.both | Specifies a WORD in which the first character in the kerning pair is in the low-order byte and the second character is in the high-order byte. |
kpKernAmount | Specifies the signed amount that this pair will be kerned if they appear side by side in the same font and size. This value is typically negative since pair-kerning usually results in two characters being set more tightly than normal. |
The array of KERNPAIR structures is sorted in increasing order by the kpPair.both field.
The values returned in the KERNPAIR structures are affected by whether relative character widths are enabled or disabled. For more information, see the description of the ENABLERELATIVEWIDTHS escape earlier in this chapter.