Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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;

Parameters

fontFamilyName [in]

Type: const WCHAR*

An array of characters that contains the name of the font family

fontCollection

Type: IDWriteFontCollection*

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

fontWeight

Type: DWRITE_FONT_WEIGHT

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

fontStyle

Type: DWRITE_FONT_STYLE

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

fontStretch

Type: DWRITE_FONT_STRETCH

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

fontSize

Type: FLOAT

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

localeName [in]

Type: const WCHAR*

An array of characters that contains the locale name.

textFormat [out]

Type: IDWriteTextFormat**

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

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

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

Dwrite.h

Library

Dwrite.lib

DLL

Dwrite.dll

See also

IDWriteFactory

 

 

Community Additions

Show:
© 2014 Microsoft