ScriptJustify function (usp10.h)
Creates an advance widths table to allow text justification when passed to the ScriptTextOut function.
HRESULT ScriptJustify( [in] const SCRIPT_VISATTR *psva, [in] const int *piAdvance, [in] int cGlyphs, [in] int iDx, [in] int iMinKashida, [out] int *piJustify );
Pointer to an array, of length indicated by cGlyphs, containing SCRIPT_VISATTR structures. Each structure contains visual attributes for a glyph in the line to process.
Pointer to an advance widths array, of length indicated by cGlyphs, obtained from a previous call to ScriptPlace.
Count of glyphs for the arrays indicated by psva and piAdvance. This parameter also indicates the count of glyphs for the output parameter piJustify.
Width, in pixels, of the desired change, either an increase of decrease.
Minimum width of a kashida glyph to generate.
Pointer to a buffer in which this function retrieves an array, of length indicated by cGlyphs, containing justified advance widths. The justified widths are sometimes called "cell widths" to distinguish them from unjustified advance widths.
Returns 0 if successful. The function returns a nonzero HRESULT value if it does not succeed. The application can test the return value with the SUCCEEDED and FAILED macros.
See Displaying Text with Uniscribe for a discussion of the context in which this function is normally called.
This function provides a simple implementation of multilingual justification. It establishes the amount of adjustment to make at each glyph position on the line. It interprets the SCRIPT_VISATTR array generated by a call to ScriptShape, giving top priority to kashida. The function uses interword spacing if no kashida points are available. It uses intercharacter spacing if no interword points are available.
ScriptJustify creates a justified array containing updated advance widths for each glyph. When an advance width for a glyph is increased, the extra width is rendered to the right of the glyph, with a white space or, for Arabic text, a kashida.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Redistributable||Internet Explorer 5 or later on Windows Me/98/95|