Platform SDK: International Features

ScriptApplyLogicalWidth

The ScriptApplyLogicalWidth function takes an array of advance widths for a run and generates an array of glyph widths that are suitable for passing to the piJustify parameter of ScriptTextOut.

HESULT WINAPI ScriptApplyLogicalWidth(
  const int *piDx,
  int cChars,
  int cGlyphs,
  const WORD *pwLogClust,
  const SCRIPT_VISATTR *psva,
  const int *piAdvance,
  const SCRIPT_ANALYSIS *psa,
  ABC *pABC,
  int *piJustify,
);

Parameters

piDx
[in] Pointer to an array of dx widths in logical order, one per code point.
cChars
[in] Count of the logical code points in the run.
cGlyphs
[in] Glyph count.
pwLogClust
[in] Pointer to an array of logical clusters from ScriptShape.
psva
[in] Pointer to a SCRIPT_VISATTR structure from ScriptShape and updated by ScriptPlace.
piAdvance
[in] Pointer to an array of glyph advance widths from ScriptPlace.
psa
[in] Pointer to a SCRIPT_ANALYSIS structure from ScriptItemize and updated by ScriptShape and ScriptPlace.
pABC
[in/out] Pointer to the overall ABC width of a run. It is optional. If present, when the function is called, it should contain the run ABC widths returned by ScriptPlace; when the function returns, the ABC width has been updated to match the new widths.
piJustify
[out] Pointer to an array that receives the resulting glyph advance widths. This is suitable for passing to the piJustify parameter of ScriptTextOut.

Return Values

If the function succeeds, the return value is zero.

If the function fails, it returns a nonzero value. And if any other unrecoverable error is encountered, it is also returned as HRESULT. For example, error returns from Win32 API functions are converted to HRESULT using the HRESULT_FROM_WIN32 macro and returned to the client in the HRESULT.

Remarks

ScriptApplyLogicalWidth may be used to reapply logical widths obtained with ScriptGetLogicalWidths. It may be useful in situations such as metafiling, where it is necessary to record and reapply advance width information in a font-independent manner, independent of glyph substitutions such as ligaturisation.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Usp10.h.
  Library: Use Usp10.lib.

See Also

Uniscribe Overview, Uniscribe Functions, ScriptGetLogicalWidths, ScriptItemize, ScriptPlace, ScriptShape, ScriptTextOut, SCRIPT_ANALYSIS, SCRIPT_VISATTR