# GrapeCity.Documents.Text.Font.CollectionFromFile

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Text_Font_CollectionFromFile_" data-uid="GrapeCity.Documents.Text.Font.CollectionFromFile*">CollectionFromFile Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Text_Font_CollectionFromFile_" data-uid="GrapeCity.Documents.Text.Font.CollectionFromFile*"></a>
<h4 id="GrapeCity_Documents_Text_Font_CollectionFromFile_System_String_System_Collections_Generic_List_GrapeCity_Documents_Text_Font__System_Boolean_" data-uid="GrapeCity.Documents.Text.Font.CollectionFromFile(System.String,System.Collections.Generic.List{GrapeCity.Documents.Text.Font},System.Boolean)">CollectionFromFile(string, List&lt;Font&gt;, bool)</h4>
<div class="markdown level1 summary"><p>Loads all <a class="xref" href="GrapeCity.Documents.Text.Font.html">Font</a>s from a specified 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 int CollectionFromFile(string path, List&lt;Font&gt; fonts, bool initCodeMap = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function CollectionFromFile(path As String, fonts As List(Of Font), Optional initCodeMap As Boolean = False) As Integer</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.collections.generic.list-1">List</a>&lt;<a class="xref" href="GrapeCity.Documents.Text.Font.html">Font</a>&gt;</td>
      <td><span class="parametername">fonts</span></td>
      <td><p>The destination list of fonts. It must be initialized beforehand.</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 loaded fonts 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="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>The number of loaded fonts.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
