# GrapeCity.Documents.Text.Font.CollectionFromArray

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Text_Font_CollectionFromArray_" data-uid="GrapeCity.Documents.Text.Font.CollectionFromArray*">CollectionFromArray Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Text_Font_CollectionFromArray_" data-uid="GrapeCity.Documents.Text.Font.CollectionFromArray*"></a>
<h4 id="GrapeCity_Documents_Text_Font_CollectionFromArray_System_Byte___System_Collections_Generic_List_GrapeCity_Documents_Text_Font__System_Boolean_" data-uid="GrapeCity.Documents.Text.Font.CollectionFromArray(System.Byte[],System.Collections.Generic.List{GrapeCity.Documents.Text.Font},System.Boolean)">CollectionFromArray(byte[], 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 byte array containing single font or a font collection.</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 CollectionFromArray(byte[] fontData, List&lt;Font&gt; fonts, bool initCodeMap = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function CollectionFromArray(fontData As Byte(), 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.byte">byte</a>[]</td>
      <td><span class="parametername">fontData</span></td>
      <td><p>The byte array with 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>
