# C1.Util.DX.DirectWrite.FontFile.Create

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_FontFile_Create_" data-uid="C1.Util.DX.DirectWrite.FontFile.Create*">Create Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_FontFile_Create_" data-uid="C1.Util.DX.DirectWrite.FontFile.Create*"></a>
<h4 id="C1_Util_DX_DirectWrite_FontFile_Create_C1_Util_DX_DirectWrite_Factory_System_String_" data-uid="C1.Util.DX.DirectWrite.FontFile.Create(C1.Util.DX.DirectWrite.Factory,System.String)">Create(Factory, string)</h4>
<div class="markdown level1 summary"><p>Creates a font file reference object from a local font file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static FontFile Create(Factory factory, string filePath)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(factory As Factory, filePath As String) As FontFile</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>A reference to a DirectWrite factory <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">filePath</span></td>
      <td><p>An array of characters that contains the absolute file path for the font file. Subsequent operations on the constructed object may fail if the user provided filePath doesn't correspond to a valid file on the disk.</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.FontFile.html">FontFile</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DirectWrite_FontFile_Create_" data-uid="C1.Util.DX.DirectWrite.FontFile.Create*"></a>
<h4 id="C1_Util_DX_DirectWrite_FontFile_Create_C1_Util_DX_DirectWrite_Factory_System_String_System_Nullable_System_Int64__" data-uid="C1.Util.DX.DirectWrite.FontFile.Create(C1.Util.DX.DirectWrite.Factory,System.String,System.Nullable{System.Int64})">Create(Factory, string, long?)</h4>
<div class="markdown level1 summary"><p>Creates a font file reference object from a local font file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static FontFile Create(Factory factory, string filePath, long? lastWriteTime)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(factory As Factory, filePath As String, lastWriteTime As Long?) As FontFile</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>A reference to a DirectWrite factory <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">filePath</span></td>
      <td><p>An array of characters that contains the absolute file path for the font file. Subsequent operations on the constructed object may fail if the user provided filePath doesn't correspond to a valid file on the disk.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a>?</td>
      <td><span class="parametername">lastWriteTime</span></td>
      <td><p>The last modified time of the input file path. If the parameter is omitted, the function will access the font file to obtain its last write time. You should specify this value to avoid extra disk access. Subsequent operations on the constructed object may fail if the user provided lastWriteTime doesn't match the file on the disk.</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.FontFile.html">FontFile</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DirectWrite_FontFile_Create_" data-uid="C1.Util.DX.DirectWrite.FontFile.Create*"></a>
<h4 id="C1_Util_DX_DirectWrite_FontFile_Create_C1_Util_DX_DirectWrite_Factory_System_IntPtr_System_Int32_C1_Util_DX_DirectWrite_FontFileLoader_" data-uid="C1.Util.DX.DirectWrite.FontFile.Create(C1.Util.DX.DirectWrite.Factory,System.IntPtr,System.Int32,C1.Util.DX.DirectWrite.FontFileLoader)">Create(Factory, nint, int, FontFileLoader)</h4>
<div class="markdown level1 summary"><p>Creates a reference to an application-specific font file resource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static FontFile Create(Factory factory, nint fontFileReferenceKey, int fontFileReferenceKeySize, FontFileLoader fontFileLoader)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(factory As Factory, fontFileReferenceKey As IntPtr, fontFileReferenceKeySize As Integer, fontFileLoader As FontFileLoader) As FontFile</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>A reference to a DirectWrite factory <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.intptr">nint</a></td>
      <td><span class="parametername">fontFileReferenceKey</span></td>
      <td><p>A font file reference key that uniquely identifies the font file resource during the lifetime of fontFileLoader.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">fontFileReferenceKeySize</span></td>
      <td><p>The size of the font file reference key in bytes.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.FontFileLoader.html">FontFileLoader</a></td>
      <td><span class="parametername">fontFileLoader</span></td>
      <td><p>The font file loader that will be used by the font system to load data from the file identified by fontFileReferenceKey.</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.FontFile.html">FontFile</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DirectWrite_FontFile_Create_C1_Util_DX_DirectWrite_Factory_System_IntPtr_System_Int32_C1_Util_DX_DirectWrite_FontFileLoader__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This function is provided for cases when an application or a document needs to use a private font without having to install it on the system. fontFileReferenceKey has to be unique only in the scope of the fontFileLoader used in this call.</p>
</div>
</div>
