Platform SDK: International Features |
The ScriptCPtoX function returns the x offset from the left end (!fLogical) or leading edge (fLogical) of a run to either the leading or trailing edge of a logical character cluster.
HRESULT WINAPI ScriptCPtoX( int iCP, BOOL fTrailing, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piX );
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.
The iCP parameter is the offset of any logical character in the cluster.
For scripts in which the caret may conventionally be placed in the middle of clusters (for example, Arabic and Hebrew), the returned x may be an interpolated position for any code point in the line.
For scripts in which the caret is conventionally snapped to the boundaries of clusters, (for example, Thai and Indian), the resulting x position will be snapped to the requested edge of the cluster containing iCP.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Usp10.h.
Library: Use Usp10.lib.
Uniscribe Overview, Uniscribe Functions, ScriptXtoCP, SCRIPT_ANALYSIS, SCRIPT_VISATTR