# C1.Util.DX.DirectWrite.TextLayout1.Create

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_TextLayout1_Create_" data-uid="C1.Util.DX.DirectWrite.TextLayout1.Create*">Create Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_TextLayout1_Create_" data-uid="C1.Util.DX.DirectWrite.TextLayout1.Create*"></a>
<h4 id="C1_Util_DX_DirectWrite_TextLayout1_Create_C1_Util_DX_DirectWrite_Factory_System_String_C1_Util_DX_DirectWrite_TextFormat_System_Single_System_Single_" data-uid="C1.Util.DX.DirectWrite.TextLayout1.Create(C1.Util.DX.DirectWrite.Factory,System.String,C1.Util.DX.DirectWrite.TextFormat,System.Single,System.Single)">Create(Factory, string, TextFormat, float, float)</h4>
<div class="markdown level1 summary"><p>Takes a string, text format, and associated constraints, and produces an object that represents the fully analyzed and formatted result.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static TextLayout1 Create(Factory factory, string text, TextFormat textFormat, float maxWidth, float maxHeight)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(factory As Factory, text As String, textFormat As TextFormat, maxWidth As Single, maxHeight As Single) As TextLayout1</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.Factory.html">Factory</a></td>
      <td><span class="parametername">factory</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.DirectWrite.Factory.html">Factory</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>An array of characters that contains the string to create a new <a class="xref" href="C1.Util.DX.DirectWrite.TextLayout1.html">TextLayout1</a> object from. This array must be of length stringLength and can contain embedded NULL characters.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.TextFormat.html">TextFormat</a></td>
      <td><span class="parametername">textFormat</span></td>
      <td><p>A pointer to an object that indicates the format to apply to the string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">maxWidth</span></td>
      <td><p>The width of the layout box.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">maxHeight</span></td>
      <td><p>The height of the layout box.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.TextLayout1.html">TextLayout1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DirectWrite_TextLayout1_Create_" data-uid="C1.Util.DX.DirectWrite.TextLayout1.Create*"></a>
<h4 id="C1_Util_DX_DirectWrite_TextLayout1_Create_C1_Util_DX_DirectWrite_Factory_System_String_C1_Util_DX_DirectWrite_TextFormat_System_Single_System_Single_System_Single_System_Boolean_" data-uid="C1.Util.DX.DirectWrite.TextLayout1.Create(C1.Util.DX.DirectWrite.Factory,System.String,C1.Util.DX.DirectWrite.TextFormat,System.Single,System.Single,System.Single,System.Boolean)">Create(Factory, string, TextFormat, float, float, float, bool)</h4>
<div class="markdown level1 summary"><p>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.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static TextLayout1 Create(Factory factory, string text, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, bool useGdiNatural)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(factory As Factory, text As String, textFormat As TextFormat, layoutWidth As Single, layoutHeight As Single, pixelsPerDip As Single, useGdiNatural As Boolean) As TextLayout1</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.Factory.html">Factory</a></td>
      <td><span class="parametername">factory</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.DirectWrite.Factory.html">Factory</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>An array of characters that contains the string to create a new <span class="xref">C1.Win.DX.DirectWrite.TextLayout1</span> object from. This array must be of length stringLength and can contain embedded NULL characters.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.TextFormat.html">TextFormat</a></td>
      <td><span class="parametername">textFormat</span></td>
      <td><p>The text formatting object to apply to the string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">layoutWidth</span></td>
      <td><p>The width of the layout box.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">layoutHeight</span></td>
      <td><p>The height of the layout box.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">pixelsPerDip</span></td>
      <td><p>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).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">useGdiNatural</span></td>
      <td><p>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.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.TextLayout1.html">TextLayout1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DirectWrite_TextLayout1_Create_C1_Util_DX_DirectWrite_Factory_System_String_C1_Util_DX_DirectWrite_TextFormat_System_Single_System_Single_System_Single_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>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.</p>
</div>


<a id="C1_Util_DX_DirectWrite_TextLayout1_Create_" data-uid="C1.Util.DX.DirectWrite.TextLayout1.Create*"></a>
<h4 id="C1_Util_DX_DirectWrite_TextLayout1_Create_C1_Util_DX_DirectWrite_Factory_System_String_C1_Util_DX_DirectWrite_TextFormat_System_Single_System_Single_System_Single_System_Nullable_C1_Util_DX_Matrix3x2__System_Boolean_" data-uid="C1.Util.DX.DirectWrite.TextLayout1.Create(C1.Util.DX.DirectWrite.Factory,System.String,C1.Util.DX.DirectWrite.TextFormat,System.Single,System.Single,System.Single,System.Nullable{C1.Util.DX.Matrix3x2},System.Boolean)">Create(Factory, string, TextFormat, float, float, float, Matrix3x2?, bool)</h4>
<div class="markdown level1 summary"><p>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.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static TextLayout1 Create(Factory factory, string text, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, Matrix3x2? transform, bool useGdiNatural)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(factory As Factory, text As String, textFormat As TextFormat, layoutWidth As Single, layoutHeight As Single, pixelsPerDip As Single, transform As Matrix3x2?, useGdiNatural As Boolean) As TextLayout1</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.Factory.html">Factory</a></td>
      <td><span class="parametername">factory</span></td>
      <td><p>an instance of <a class="xref" href="C1.Util.DX.DirectWrite.Factory.html">Factory</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>An array of characters that contains the string to create a new <span class="xref">C1.Win.DX.DirectWrite.TextLayout1</span> object from. This array must be of length stringLength and can contain embedded NULL characters.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.TextFormat.html">TextFormat</a></td>
      <td><span class="parametername">textFormat</span></td>
      <td><p>The text formatting object to apply to the string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">layoutWidth</span></td>
      <td><p>The width of the layout box.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">layoutHeight</span></td>
      <td><p>The height of the layout box.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">pixelsPerDip</span></td>
      <td><p>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).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Matrix3x2.html">Matrix3x2</a>?</td>
      <td><span class="parametername">transform</span></td>
      <td><p>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.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">useGdiNatural</span></td>
      <td><p>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.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.TextLayout1.html">TextLayout1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DirectWrite_TextLayout1_Create_C1_Util_DX_DirectWrite_Factory_System_String_C1_Util_DX_DirectWrite_TextFormat_System_Single_System_Single_System_Single_System_Nullable_C1_Util_DX_Matrix3x2__System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>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.</p>
</div>
</div>
