Other versions of this page are also available for the following:
Windows Mobile Not SupportedWindows Embedded CE Supported

This function takes the output of both ScriptShape and ScriptPlace calls and calls the operating system ExtTextOut function appropriately.

All arrays are in display order unless the fLogicalOrder member is set in the SCRIPT_ANALYSIS structure pointed to by psa.

  const HDC hdc, 
  int x, 
  int y, 
  UINT fuOptions, 
  const RECT* lprc, 
  const SCRIPT_ANALYSIS* psa, 
  const WCHAR* pwcReserved, 
  int iReserved, 
  const WORD* pwGlyphs, 
  int cGlyphs, 
  const int* piAdvance, 
  const int* piJustify, 
  const GOFFSET* pGoffset 


[in] Handle to a device context.


[in, out] Pointer to a SCRIPT_CACHE structure.


[in] Value of the x-coordinate of the first glyph.


[in] Value of the y-coordinate of the first glyph.


[in] Options equivalent to the fuOptions parameter of ExtTextOut. It may contain ETO_CLIPPED or ETO_OPAQUE (or neither of them, or both of them).


[in] Pointer to a rectangle used to clip the display. This parameter is optional and can be NULL.


[in] Pointer to a SCRIPT_ANALYSIS structure obtained from a previous call to ScriptItemize.


Reserved, must be NULL.


Reserved, must be zero.


[in] Pointer to an array of glyphs obtained from a previous call to ScriptShape.


[in] Count of the glyphs in the pwGlyphs array. The maximum number of glyphs is 65,536.


[in] Pointer to an array of advance widths obtained from a previous call to ScriptPlace.


[in] Pointer to an array of justified advance widths. This parameter is optional and can be NULL.


[in] Pointer to a GOFFSET structure containing the x and y offsets for the combining glyph.

If the function succeeds, the return value is zero.

If the function fails, it returns a nonzero value. If any other unrecoverable error is encountered, it is returned as an HRESULT.

For any run that is rendered right-to-left (fRTL) and was generated in logical order by forcing the fLogicalOrder flag, call SetTextAlign(hdc, TA_RIGHT) and give the right-side coordinate before calling ScriptTextOut.

The piJustify array provides requested cell widths for each glyph. When the piJustify width of a glyph differs from the unjustified width (in piAdvance), space is added to or removed from the glyph cell at its trailing edge. The glyph is always aligned with the leading edge of its cell. (This rule applies even in visual order.)

When a glyph cell is extended the extra space is usually made up by the addition of white space, however for Arabic scripts, the extra space is made up by one or more kashida glyphs, unless the extra space is insufficient for the shortest kashida glyph in the font. (The width of the shortest kashida is available by calling ScriptGetFontProperties.)

The piJustify parameter should be passed only if the string must be justified again. Normally, pass NULL to this parameter.

The pwcinChars and cChars parameters are required only if output is to a metafile DC. If hdc is not a metafile, these parameters may be passed as NULL and zero.

Do not use ScriptTextOut to write to a metafile unless you are sure that the metafile will be played back without any font substitution. ScriptTextOut records glyph numbers in the metafile, and since glyph numbers vary considerably from one font to another, such a metafile is unlikely to play back correctly when different fonts are substituted. For example, when a metafile is played back at a different scale, a CreateFont request that is recorded in the metafile may resolve to a bitmap instead of a TrueType font. Likewise, if the metafile is played back on a different machine, the requested fonts may not be installed. To write complex scripts in a metafile in a font-independent manner, use ExtTextOut to write the logical characters directly, so that glyph generation and placement do not occur until the text is played back.

Windows Embedded CEWindows CE 5.0 and later