IDWriteFactory::CreateTextFormat Method

Creates a text format object used for text layout.

Syntax

virtual HRESULT CreateTextFormat(
  [in]   const WCHAR * fontFamilyName,
  IDWriteFontCollection * fontCollection,
  DWRITE_FONT_WEIGHT  fontWeight,
  DWRITE_FONT_STYLE  fontStyle,
  DWRITE_FONT_STRETCH  fontStretch,
  FLOAT  fontSize,
  [in]   const WCHAR * localeName,
  [out]  IDWriteTextFormat ** textFormat
) = 0;

Parameter

  • fontFamilyName [in]
    An array of characters that contains the name of the font family

  • fontCollection
    A pointer to a font collection object. When this is NULL, indicates the system font collection.

  • fontWeight
    A value that indicates the font weight for the text object created by this method.

  • fontStyle
    A value that indicates the font style for the text object created by this method.

  • fontStretch
    A value that indicates the font stretch for the text object created by this method.

  • fontSize
    The logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.

  • localeName [in]
    An array of characters that contains the locale name.

  • textFormat [out]
    When this method returns, contains an address of a pointer to a newly created text format object, or NULL in case of failure.

Rückgabewert

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

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