IDWriteFactory::CreateNumberSubstitution method
Creates a number substitution object using a locale name, substitution method, and an indicator whether to ignore user overrides (use NLS defaults for the given culture instead).
Syntax
virtual HRESULT CreateNumberSubstitution( [in] DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod, [in] const WCHAR * localeName, [in] BOOL ignoreUserOverride, [out] IDWriteNumberSubstitution ** numberSubstitution ) = 0;
Parameters
- substitutionMethod [in]
-
Type: DWRITE_NUMBER_SUBSTITUTION_METHOD
A value that specifies how to apply number substitution on digits and related punctuation.
- localeName [in]
-
Type: const WCHAR*
The name of the locale to be used in the numberSubstitution object.
- ignoreUserOverride [in]
-
Type: BOOL
A Boolean flag that indicates whether to ignore user overrides.
- numberSubstitution [out]
-
Type: IDWriteNumberSubstitution**
When this method returns, contains an address to a pointer to the number substitution object created by this method.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Examples
The following code example shows how to create a number substitution for traditional Arabic Egyptian digits, which always display regardless of surrounding context.
// Create a number substitution that uses Arabic Egyptian digits. IDWriteNumberSubstitution* pSubstitution = NULL; if (SUCCEEDED(hr)) { hr = pDWriteFactory->CreateNumberSubstitution( DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL, L"ar-eg", true, // user override &pSubstitution ); }
Requirements
|
Minimum supported client |
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps] |
|
Minimum supported phone |
Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also