Platform SDK: International Features

ScriptBreak

The ScriptBreak function returns information for determining line breaks.

HRESULT WINAPI ScriptBreak( 
  const WCHAR *pwcChars, 
  int cChars, 
  const SCRIPT_ANALYSIS *psa, 
  SCRIPT_LOGATTR *psla 
);

Parameters

pwcChars
[in] Unicode characters to be processed.
cChars
[in] Number of Unicode characters to be processed.
psa
[in] Pointer to the SCRIPT_ANALYSIS structure obtained from an earlier call to the ScriptItemize function.
psla
[out] Pointer to a buffer that receives the character attributes as a SCRIPT_LOGATTR structure.

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 ScriptBreak function returns cursor movement and formatting break positions for an item in an array of SCRIPT_LOGATTR structures. To support mixed formatting within a single word correctly, ScriptBreak should be passed whole items as returned by ScriptItemize and not the finer formatting runs.

ScriptBreak does not require an hdc and does not perform shaping.

The SCRIPT_LOGATTR structure, pointed to by psla, identifies valid caret positions and line breaks. The SCRIPT_LOGATTR.fCharStop flag marks cluster boundaries for those scripts where it is conventional to restrict from moving inside clusters. The same boundaries could also be inferred by inspecting the pwLogCLust array returned by ScriptShape, however ScriptBreak is considerably faster in implementation and does not require an hdc to be prepared. The fWordStop, fSoftBreak, and fWhiteSpace flags in SCRIPT_LOGATTR are only available through ScriptBreak.

Most shaping engines that identify invalid sequences do so by setting the fInvalid flag in ScriptBreak. The fInvalidLogAttr flag in SCRIPT_PROPERTIES identifies which scripts do this.

Requirements

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

See Also

Uniscribe Overview, Uniscribe Functions, ScriptItemize, ScriptShape, SCRIPT_ANALYSIS, SCRIPT_LOGATTR