Platform SDK: International Features

ScriptPlace

The ScriptPlace function takes the output of a ScriptShape call and generates glyph advance width and two-dimensional offset information.

HRESULT WINAPI ScriptPlace(
  HDC hdc, 
  SCRIPT_CACHE *psc, 
  const WORD *pwGlyphs, 
  int cGlyphs, 
  const SCRIPT_VISATTR *psva, 
  SCRIPT_ANALYSIS *psa, 
  int *piAdvance, 
  GOFFSET *pGoffset, 
  ABC *pABC 
);

Parameters

hdc
[in] Handle to the device context.
psc
[in/out] Pointer to a SCRIPT_CACHE structure.
pwGlyphs
[in] Pointer to a glyph buffer obtained from an earlier call to the ScriptShape function.
cGlyphs
[in] Count of glyphs in the glyph buffer.
psva
[in] Pointer to an array of SCRIPT_VISATTR structures.
psa
[in/out] Pointer to an array of SCRIPT_ANALYSIS structures obtained from a previous call to ScriptItemize.
piAdvance
[out] Pointer to an array that receives the advance width information.
pGoffset
[out] Pointer to a GOFFSET structure that receives the x and y offset of the combining glyph.
pABC
[out] Pointer to an ABC structure that receives the ABC widths for the entire run.

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

The composite ABC width for the whole item identifies how much the glyphs overhang to the left of the start position and to the right of the length implied by the sum of the advance widths. The total advance width of the line is exactly abcA+abcB+abcC. The abcA and abcC values are maintained as proportions of the cell height represented in 8 bits and are thus roughly +/-1%. The total width returned, which is the sum of the abcA+abcB+abcC values pointed to by piAdvance, is accurate to the resolution of the TrueType shaping engine.

All arrays are in visual order unless the fLogicalOrder member is set in the psa parameter.

Requirements

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

See Also

Uniscribe Overview, Uniscribe Functions, ScriptItemize, ScriptShape, ABC, GOFFSET, SCRIPT_ANALYSIS, SCRIPT_CACHE, SCRIPT_VISATTR