short Escape(hDC, SETALLJUSTVALUES, sizeof(JUST_VALUE_STRUCT),lpInData, NULL)
This escape sets all of the text-justification values that are used for text output.
Text justification is the process of inserting extra pixels among break characters in a line of text. The blank character is normally used as a break character.
Parameter | Type/Description |
hDC | HDC Identifies the device context. | |
lpInData | JUST_VALUE_STRUCT FAR * Points to a JUST_VALUE_STRUCT data structure that defines the text-justification values. See the following “Comments” section for more information on the JUST_VALUE_STRUCT data structure. |
The return value specifies the outcome of the escape. It is 1 if the escape is successful. Otherwise, it is zero.
The lpInData parameter points to a JUST_VALUE_STRUCT data structure that describes the text-justification values used for text output. The JUST_VALUE_STRUCT structure has the following format:
typedef struct {
short nCharExtra;
WORD nCharCount;
short nBreakExtra;
WORD nBreakCount;
} JUST_VALUE_STRUCT;
This structure has the following fields:
Field | Description |
nCharExtra | Specifies the total extra space (in font units) that must be distributed over nCharCount characters. |
nCharCount | Specifies the number of characters over which nCharExtra 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 nBreak-Extra is distributed. |
The units used for nCharExtra and nBreakExtra 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 field when it has output the number of characters specified in the nCharCount field. Likewise, it stops distributing the space specified by the nBreakExtra field when it has output the number of characters specified by the nBreakCount field. A call on the same string to the GetText-Extent function made immediately after the call to the TextOut function will be processed in the same manner.
To re-enable justification with the SetTextJustification and SetTextCharacterExtra functions, an application should call the SETALLJUSTVALUES escape and set the nCharExtra and nBreakExtra fields to zero.