Freigeben über


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;

Parameter

  • substitutionMethod [in]
    A value that specifies how to apply number substitution on digits and related punctuation.

  • localeName [in]
    The name of the locale to be used in the numberSubstitution object.

  • ignoreUserOverride [in]
    A Boolean flag that indicates whether to ignore user overrides.

  • numberSubstitution [out]
    When this method returns, contains an address to a pointer to the number substitution object created by this method.

Rückgabewert

Ist Methode erfolgreich, wird "S_OK" zurückgegeben. Andernfalls wird ein HRESULT-Fehlercode zurückgegeben.

Beispiele

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
            );
    }

Anforderungen

Mindestens unterstützter Client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista

Mindestens unterstützter Server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008

Header

Dwrite.h

Bibliothek

Dwrite.lib

DLL

Dwrite.dll

Siehe auch

IDWriteFactory