ScriptApplyLogicalWidth function (usp10.h)

Takes an array of advance widths for a run and generates an array of adjusted advance glyph widths.

Syntax

HRESULT ScriptApplyLogicalWidth(
  [in]                const int             *piDx,
  [in]                int                   cChars,
  [in]                int                   cGlyphs,
  [in]                const WORD            *pwLogClust,
  [in]                const SCRIPT_VISATTR  *psva,
  [in]                const int             *piAdvance,
  [in]                const SCRIPT_ANALYSIS *psa,
  [in, out, optional] ABC                   *pABC,
  [out]               int                   *piJustify
);

Parameters

[in] piDx

Pointer to an array of advance widths in logical order, one per code point.

[in] cChars

Count of the logical code points in the run.

[in] cGlyphs

Glyph count.

[in] pwLogClust

Pointer to an array of logical clusters from ScriptShape.

[in] psva

Pointer to a SCRIPT_VISATTR structure from ScriptShape and updated by ScriptPlace.

[in] piAdvance

Pointer to an array of glyph advance widths from ScriptPlace.

[in] psa

Pointer to a SCRIPT_ANALYSIS structure from ScriptItemize and updated by ScriptShape and ScriptPlace.

[in, out, optional] pABC

Pointer to the overall ABC width of a run. On input, the parameter should contain the run ABC widths retrieved by ScriptPlace. On output, the parameter indicates the ABC width updated to match the new widths.

[out] piJustify

Pointer to an array in which the function retrieves the glyph advance widths. This array is suitable for passing to the piJustify parameter of ScriptTextOut.

Return value

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.

Remarks

This function can be used to reapply logical widths obtained with ScriptGetLogicalWidths. It can be useful in situations such as metafiling, for which advance width information must be recorded and reapplied in a font-independent manner, independent of glyph substitutions, such as ligaturization.

Important  Starting with Windows 8: To maintain the ability to run on Windows 7, a module that uses Uniscribe must specify Usp10.lib before gdi32.lib in its library list.
 

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header usp10.h
Library Usp10.lib
DLL Usp10.dll
Redistributable Internet Explorer 5 or later on Windows Me/98/95

See also

SCRIPT_ANALYSIS

SCRIPT_VISATTR

ScriptGetLogicalWidths

ScriptItemize

ScriptPlace

ScriptShape

ScriptTextOut

Uniscribe

Uniscribe Functions