# GrapeCity.Documents.Text.Font.FromFile

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Text_Font_FromFile_" data-uid="GrapeCity.Documents.Text.Font.FromFile*">FromFile Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Text_Font_FromFile_" data-uid="GrapeCity.Documents.Text.Font.FromFile*"></a>
<h4 id="GrapeCity_Documents_Text_Font_FromFile_System_String_System_Boolean_" data-uid="GrapeCity.Documents.Text.Font.FromFile(System.String,System.Boolean)">FromFile(string, bool)</h4>
<div class="markdown level1 summary"><p>Loads the first <a class="xref" href="GrapeCity.Documents.Text.Font.html">Font</a> from a specified 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 Font FromFile(string path, bool initCodeMap = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FromFile(path As String, Optional initCodeMap As Boolean = False) As Font</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">path</span></td>
      <td><p>The path to the file containing the font data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">initCodeMap</span></td>
      <td><p>Set this parameter to True if you're planning to add the font to the fallback font collection.</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="GrapeCity.Documents.Text.Font.html">Font</a></td>
      <td><p>The newly created font, or null if the file did not contain any fonts.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Text_Font_FromFile_" data-uid="GrapeCity.Documents.Text.Font.FromFile*"></a>
<h4 id="GrapeCity_Documents_Text_Font_FromFile_System_String_System_String_" data-uid="GrapeCity.Documents.Text.Font.FromFile(System.String,System.String)">FromFile(string, string)</h4>
<div class="markdown level1 summary"><p>Loads a <a class="xref" href="GrapeCity.Documents.Text.Font.html">Font</a> with given full font name from a specified 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 Font FromFile(string path, string fullFontName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FromFile(path As String, fullFontName As String) As Font</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">path</span></td>
      <td><p>The path to the file containing the font data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fullFontName</span></td>
      <td><p>The full font name to be loaded.</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="GrapeCity.Documents.Text.Font.html">Font</a></td>
      <td><p>The newly created font.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
