ScriptApplyDigitSubstitution
The ScriptApplyDigitSubstitution function applies the digit substitution settings recorded in a SCRIPT_DIGITSUBSTITUTE structure to the SCRIPT_CONTROL and SCRIPT_STATE structures.
HRESULT WINAPI ScriptApplyDigitSubstitution(
const SCRIPT_DIGITSUBSTITUTE *psds,
SCRIPT_CONTROL *psc,
SCRIPT_STATE *pss
);
Parameters
- psds
- [in] Pointer to a SCRIPT_DIGITSUBSTITUTE structure. If NULL, ScriptApplyDigitSubstitution calls ScriptRecordDigitSubstitution with LOCALE_USER_DEFAULT.
- psc
- [out] Pointer to a SCRIPT_CONTROL structure. When this function returns, the fContextDigits and uDefaultLanguage members are updated.
- pss
- [out] Pointer to a SCRIPT_STATE structure. When this function returns, the fDigitSubstitute member will be updated.
Return Values
If the function succeeds, it returns S_OK.
If the DigitSubstitute member of SCRIPT_DIGITSUBSTITUTE structure is unrecognized, the function returns E_INVALIDARG. And if any other unrecoverable error is encountered, it is also returned as an 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 DigitSubstitute member of SCRIPT_DIGITSUBSTITUTE structure is normally set by ScriptRecordDigitSubstitution. However, it may be replaced by any one of the following values:
- SCRIPT_DIGITSUBSTITUTE_CONTEXT - Digits U+0030 to U+0039 are substituted using the language of the prior letters. If there are no prior letters, digits are substituted using the TraditionalDigitLanguage member of the SCRIPT_DIGITSUBSTITUTE structure. This member is normally set to the primary language of the locale passed to ScriptRecordDigitSubstitution.
- SCRIPT_DIGITSUBSTITUTE_NATIONAL - Digits U+0030 to U+0039 are substituted using the NationalDigitLanguage member of the SCRIPT_DIGITSUBSTITUTE structure. This member is normally set to the national digits returned for the NLS LCTYPE LOCALE_SNATIVEDIGITS by ScriptRecordDigitSubstitution.
- SCRIPT_DIGITSUBSTITUTE_NONE - Digits are not substituted. Unicode values U+0030 to U+0039 are displayed with Arabic, that is Western, numerals.
- SCRIPT_DIGITSUBSTITUTE_TRADITIONAL - Digits U+0030 to U+0039 are substituted using the TraditionalDigitLanguage member of the SCRIPT_DIGITSUBSTITUTE structure. This member is normally set to the primary language of the locale passed to ScriptRecordDigitSubstitution.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Usp10.h.
Library: Use Usp10.lib.
See Also
Uniscribe Overview, Uniscribe Functions, ScriptRecordDigitSubstitution, SCRIPT_CONTROL, SCRIPT_DIGITSUBSTITUTE, SCRIPT_STATE