[]
        
(Showing Draft Content)

C1.Util.DX.DirectWrite.TextLayout1.Create

Create Method

Create(Factory, string, TextFormat, float, float)

Takes a string, text format, and associated constraints, and produces an object that represents the fully analyzed and formatted result.

Declaration
public static TextLayout1 Create(Factory factory, string text, TextFormat textFormat, float maxWidth, float maxHeight)
Parameters
Type Name Description
Factory factory

an instance of Factory

string text

An array of characters that contains the string to create a new TextLayout1 object from. This array must be of length stringLength and can contain embedded NULL characters.

TextFormat textFormat

A pointer to an object that indicates the format to apply to the string.

float maxWidth

The width of the layout box.

float maxHeight

The height of the layout box.

Returns
Type Description
TextLayout1

Create(Factory, string, TextFormat, float, float, float, bool)

Create a Gdi Compatible TextLayout. Takes a string, format, and associated constraints, and produces an object representing the result, formatted for a particular display resolution and measuring mode.

Declaration
public static TextLayout1 Create(Factory factory, string text, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, bool useGdiNatural)
Parameters
Type Name Description
Factory factory

an instance of Factory

string text

An array of characters that contains the string to create a new C1.Win.DX.DirectWrite.TextLayout1 object from. This array must be of length stringLength and can contain embedded NULL characters.

TextFormat textFormat

The text formatting object to apply to the string.

float layoutWidth

The width of the layout box.

float layoutHeight

The height of the layout box.

float pixelsPerDip

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).

bool useGdiNatural

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.

Returns
Type Description
TextLayout1
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.

Create(Factory, string, TextFormat, float, float, float, Matrix3x2?, bool)

Create a Gdi Compatible TextLayout. Takes a string, format, and associated constraints, and produces an object representing the result, formatted for a particular display resolution and measuring mode.

Declaration
public static TextLayout1 Create(Factory factory, string text, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, Matrix3x2? transform, bool useGdiNatural)
Parameters
Type Name Description
Factory factory

an instance of Factory

string text

An array of characters that contains the string to create a new C1.Win.DX.DirectWrite.TextLayout1 object from. This array must be of length stringLength and can contain embedded NULL characters.

TextFormat textFormat

The text formatting object to apply to the string.

float layoutWidth

The width of the layout box.

float layoutHeight

The height of the layout box.

float pixelsPerDip

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).

Matrix3x2? transform

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.

bool useGdiNatural

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.

Returns
Type Description
TextLayout1
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.