GETEXTENTTABLE

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

The GETEXTENTTABLE printer escape retrieves the width (extent) of individual characters from a group of consecutive characters in the character set for the selected font.

Parameters

hdc

HDC Identifies the device context.

lpInData

LPSTR Points to a CHAR_RANGE_STRUCT structure that defines the range of characters for which the width is to be retrieved. For more information about this structure, see the following Comments section.

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. This value is 1 if the escape is successful. It is 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 structure that defines the range of characters for which the width is to be retrieved. This structure has the following form:

struct CHAR_RANGE_STRUCT {
    CHAR chFirst;
    CHAR chLast;
};

Following are the members in the CHAR_RANGE_STRUCT structure:

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.

How an application uses the retrieved values depends upon whether relative character widths are enabled or disabled. For more information, see the description of the ENABLERELATIVEWIDTHS escape, earlier in this chapter.