Skip to content

Latest commit

 

History

History
99 lines (72 loc) · 3.72 KB

nf-usp10-scriptstringxtocp.md

File metadata and controls

99 lines (72 loc) · 3.72 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:usp10.ScriptStringXtoCP
ScriptStringXtoCP function (usp10.h)
Converts an x coordinate to a character position.
ScriptStringXtoCP
ScriptStringXtoCP function [Internationalization for Windows Applications]
_win32_ScriptStringXtoCP
intl.scriptstringxtocp
usp10/ScriptStringXtoCP
intl\scriptstringxtocp.htm
Intl
ae37f58a-cc9c-4414-a8ac-e70691e54c5e
12/05/2018
ScriptStringXtoCP, ScriptStringXtoCP function [Internationalization for Windows Applications], _win32_ScriptStringXtoCP, intl.scriptstringxtocp, usp10/ScriptStringXtoCP
usp10.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Usp10.lib
Usp10.dll
Windows
Internet Explorer 5 or later on Windows Me/98/95
19H1
ScriptStringXtoCP
usp10/ScriptStringXtoCP
c++
APIRef
kbSyntax
DllExport
Usp10.dll
Ext-MS-Win-GDI-Internal-Desktop-L1-1-0.dll
GDI32.dll
GDI32Full.dll
ScriptStringXtoCP

ScriptStringXtoCP function

-description

Converts an x coordinate to a character position.

-parameters

-param ssa [in]

A SCRIPT_STRING_ANALYSIS structure for the string.

-param iX [in]

The x coordinate.

-param piCh [out]

Pointer to a variable in which this function retrieves the character position corresponding to the x coordinate.

-param piTrailing [out]

Pointer to a variable in which this function retrieves a value indicating if the x coordinate is for the leading edge or the trailing edge of the character position. For more information, see the Remarks section.

-returns

Returns S_OK if successful. The function returns a nonzero HRESULT value if it does not succeed. The application can test the return value with the SUCCEEDED and FAILED macros.

-remarks

If the x coordinate corresponds to the leading edge of the character, the value of piTrailing is 0. If the x coordinate corresponds to the trailing edge of the character, the value of piTrailing is a positive integer. As for ScriptXtoCP, the value is 1 for a character that can be rendered on its own. The value is greater than 1 if the character is part of a cluster in a script for which cursors are not placed within a cluster, to indicate the offset to the next legitimate logical cursor position.

If the x coordinate is before the beginning of the line, the function retrieves -1 for piCh and 1 for piTrailing, indicating the trailing edge of the nonexistent character before the line. If the x coordinate is after the end of the line, the function retrieves for piCh the first index beyond the length of the line and 0 for piTrailing. The 0 value indicates the leading edge of the nonexistent character after the line.

Important  Starting with Windows 8: To maintain the ability to run on Windows 7, a module that uses Uniscribe must specify Usp10.lib before gdi32.lib in its library list.
 

-see-also

SCRIPT_STRING_ANALYSIS

Uniscribe

Uniscribe Functions