# C1.Util.DX.DirectWrite.Factory.CreateTextFormat

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_Factory_CreateTextFormat_" data-uid="C1.Util.DX.DirectWrite.Factory.CreateTextFormat*">CreateTextFormat Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_Factory_CreateTextFormat_" data-uid="C1.Util.DX.DirectWrite.Factory.CreateTextFormat*"></a>
<h4 id="C1_Util_DX_DirectWrite_Factory_CreateTextFormat_System_String_C1_Util_DX_DirectWrite_FontCollection_C1_Util_DX_DirectWrite_FontWeight_C1_Util_DX_DirectWrite_FontStyle_C1_Util_DX_DirectWrite_FontStretch_System_Single_System_String_" data-uid="C1.Util.DX.DirectWrite.Factory.CreateTextFormat(System.String,C1.Util.DX.DirectWrite.FontCollection,C1.Util.DX.DirectWrite.FontWeight,C1.Util.DX.DirectWrite.FontStyle,C1.Util.DX.DirectWrite.FontStretch,System.Single,System.String)">CreateTextFormat(string, FontCollection, FontWeight, FontStyle, FontStretch, float, string)</h4>
<div class="markdown level1 summary"><p>HRESULT IDWriteFactory::CreateTextFormat([In] const wchar_t* fontFamilyName,[In, Optional] IDWriteFontCollection* fontCollection,[In] DWRITE_FONT_WEIGHT fontWeight,[In] DWRITE_FONT_STYLE fontStyle,[In] DWRITE_FONT_STRETCH fontStretch,[In] float fontSize,[In] const wchar_t* localeName,[Out, Fast] IDWriteTextFormat** textFormat)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public TextFormat CreateTextFormat(string fontFamilyName, FontCollection fontCollection, FontWeight fontWeight, FontStyle fontStyle, FontStretch fontStretch, float fontSize, string localeName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateTextFormat(fontFamilyName As String, fontCollection As FontCollection, fontWeight As FontWeight, fontStyle As FontStyle, fontStretch As FontStretch, fontSize As Single, localeName As String) As TextFormat</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fontFamilyName</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontCollection.html">FontCollection</a></td>
      <td><span class="parametername">fontCollection</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontWeight.html">FontWeight</a></td>
      <td><span class="parametername">fontWeight</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontStyle.html">FontStyle</a></td>
      <td><span class="parametername">fontStyle</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontStretch.html">FontStretch</a></td>
      <td><span class="parametername">fontStretch</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">fontSize</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">localeName</span></td>
      <td></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.TextFormat.html">TextFormat</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
