IDWriteFactory::CreateGdiCompatibleTextLayout method
Takes a string, format, and associated constraints, and produces an object representing the result, formatted for a particular display resolution and measuring mode.
Syntax
virtual HRESULT CreateGdiCompatibleTextLayout( [in] const WCHAR * string, UINT32 stringLength, IDWriteTextFormat * textFormat, FLOAT layoutWidth, FLOAT layoutHeight, FLOAT pixelsPerDip, [in, optional] const DWRITE_MATRIX * transform, BOOL useGdiNatural, [out] IDWriteTextLayout ** textLayout ) = 0;
Parameters
- string [in]
-
Type: const WCHAR*
An array of characters that contains the string to create a new IDWriteTextLayout object from. This array must be of length stringLength and can contain embedded NULL characters.
- stringLength
-
Type: UINT32
The length of the string, in character count.
- textFormat
-
Type: IDWriteTextFormat*
The text formatting object to apply to the string.
- layoutWidth
-
Type: FLOAT
The width of the layout box.
- layoutHeight
-
Type: FLOAT
The height of the layout box.
- pixelsPerDip
-
Type: FLOAT
The number of physical pixels per DIP (device independent pixel). For example, if rendering onto a 96 DPI device pixelsPerDip is 1. If rendering onto a 120 DPI device pixelsPerDip is 1.25 (120/96).
- transform [in, optional]
-
Type: const DWRITE_MATRIX*
An optional transform applied to the glyphs and their positions. This transform is applied after the scaling specifies the font size and pixels per DIP.
- useGdiNatural
-
Type: BOOL
Instructs the text layout to use the same metrics as GDI bi-level text when set to FALSE. When set to TRUE, instructs the text layout to use the same metrics as text measured by GDI using a font created with CLEARTYPE_NATURAL_QUALITY.
- textLayout [out]
-
Type: IDWriteTextLayout**
When this method returns, contains an address to the pointer of the resultant text layout object.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The resulting text layout should only be used for the intended resolution, and for cases where text scalability is desired CreateTextLayout should be used instead.
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