ScriptCPtoX (Windows CE 5.0)
This function generates the x offset from the left end (!fLogicalOrder) or leading edge (fLogicalOrder) 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);
Parameters
- iCP
[in] Logical character position in the run. - fTrailing
[in] Indicates the edge of the logical character cluster from which to compute the offset. If TRUE, the trailing edge is used; otherwise, the leading edge is used. - cChars
[in] Number of characters in the run. - cGlyphs
[in] Number of glyphs in the run. - pwLogClust
[in] Logical clusters. - psva
[in] Pointer to an array of SCRIPT_VISATTR structures. - piAdvance
[in] Pointer to advance widths value. - psa
[in] Pointer to a SCRIPT_ANALYSIS structure. SCRIPT_ANALYSIS.fLogicalOrder specifies the end of the run: if it is set, the leading edge of the run is used; otherwise, the left end of the run is used. - piX
[out] Pointer to a variable that receives the resulting x position of the caret.
Return Values
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.
Remarks
The leading or trailing edge of the character and the leading edge of a run depend on the direction of text in the run.
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.
Requirements
OS Versions: Windows CE 5.0 and later.
Header: Usp10.h.
Link Library: Uspce.lib.
See Also
SCRIPT_ANALYSIS | SCRIPT_VISATTR
Send Feedback on this topic to the authors