SETALLJUSTVALUES

short Escape(hdc, SETALLJUSTVALUES, sizeof(EXTTEXTDATA),lpInData, NULL)

The SETALLJUSTVALUES printer escape is not recommended. Applications should use the ExtTextOut function instead of this escape. This escape sets all of the text-justification values that are used for text output in Windows 3.0 and earlier.

Text justification is the process of inserting extra pixels among break characters in a line of text. The space character is normally used as a break character.

Parameters

hdc

HDC Identifies the device context.

lpInData

EXTTEXTDATA FAR * Points to an EXTTEXTDATA structure that defines the text-justification values. For more information about this structure, see the Comments section.

Return Value

The return value specifies the outcome of the escape. This value is 1 if the escape is successful. Otherwise, it is zero.

Comments

The lpInData parameter points to an EXTTEXTDATA structure that describes the text-justification values used for text output. The EXTTEXTDATA structure has the following form:

typedef struct {
    short nSize;
    LPALLJUSTREC lpInData;
    LPFONTINFO lpFont;
    LPTEXTXFORM lpXForm;
    LPDRAWMODE lpDrawMode;
} EXTTEXTDATA;

This structure contains a JUST_VALUE_STRUCT structure that has the following form:

typedef struct {
    short nCharExtra;
    WORD cch;
    short nBreakExtra;
    WORD nBreakCount;
} JUST_VALUE_STRUCT;

Following are the members of JUST_VALUE_STRUCT structure:

nCharExtra

Specifies the total extra space, in font units, that must be distributed over cch characters.

cch

Specifies the number of characters over which the nCharExtra member is distributed.

nBreakExtra

Specifies the total extra space, in font units, that is distributed over nBreakCount characters.

nBreakCount

Specifies the number of break characters over which the nBreakExtra member is distributed.

The units used for the nCharExtra and nBreakExtra members are the font units of the device and are dependent on whether relative character widths were enabled with the ENABLERELATIVEWIDTHS escape.

The values set with this escape apply to subsequent calls to the TextOut function. The driver stops distributing the extra space specified in the nCharExtra member when it has output the number of characters specified in the nCharCountmember. Likewise, it stops distributing the space specified by the nBreakExtra member when it has output the number of characters specified by the nBreakCount member. A call on the same string to the GetTextExtent function made immediately after the call to the TextOut function will be processed in the same manner.

To reenable justification with the SetTextJustification and SetTextCharacterExtra functions, an application should call the SETALLJUSTVALUES escape and set the nCharExtra and nBreakExtra members to zero.