GETEXTENTTABLE

Syntax

short Escape(hDC, GETEXTENTTABLE, sizeof(CHAR_RANGE_STRUCT),lpInData,lpOutData)

This escape retrieves the width (extent) of individual characters from a group of consecutive characters in the selected font's character set.

Parameter Type/Description  

hDC HDC Identifies the device context.  
lpInData LPSTR Points to a CHAR_RANGE_STRUCT data structure that defines the range of characters for which the width is to be retrieved. See the following “Comments” section for more information on the CHAR_RANGE_STRUCT data structure.  
lpOutData LPINT Points to an array of short integers that receives the character widths. The size of the array must be at least (chLastchFirst + 1).  

Return Value

The return value specifies the outcome of the escape. It is 1 if the escape is successful, and zero if the escape is not successful. If the escape is not implemented, the return value is zero.

Comments

The lpInData parameter points to a CHAR_RANGE_STRUCT data structure that defines the range of characters for which the width is to be retrieved. The CHAR_RANGE_STRUCT structure has the following format:

typedef struct {

BYTE chFirst;

BYTE chLast;

} CHAR_RANGE_STRUCT

This structure has the following fields:

Field Description

chFirst Specifies the character code of the first character whose width is to be retrieved.
chLast Specifies the character code of the last character whose width is to be retrieved.

The values retrieved are affected by whether relative character widths are enabled or disabled. For more information, see the ENABLERELATIVEWIDTHS escape, earlier in this chapter.