# GrapeCity.Documents.Text.FontWriter.CompactFonts

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Text_FontWriter_CompactFonts_" data-uid="GrapeCity.Documents.Text.FontWriter.CompactFonts*">CompactFonts Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Text_FontWriter_CompactFonts_" data-uid="GrapeCity.Documents.Text.FontWriter.CompactFonts*"></a>
<h4 id="GrapeCity_Documents_Text_FontWriter_CompactFonts_System_Collections_Generic_List_GrapeCity_Documents_Text_Font__System_Int32____System_Byte______GrapeCity_Documents_Text_FontSubsetFlags_" data-uid="GrapeCity.Documents.Text.FontWriter.CompactFonts(System.Collections.Generic.List{GrapeCity.Documents.Text.Font},System.Int32[]@,System.Byte[][]@,GrapeCity.Documents.Text.FontSubsetFlags)">CompactFonts(List&lt;Font&gt;, out int[], out byte[][], FontSubsetFlags)</h4>
<div class="markdown level1 summary"><p>Merges matching TrueType font subsets and serializes the merged subsets to byte arrays.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool CompactFonts(List&lt;Font&gt; fonts, out int[] indices, out byte[][] mergedFonts, FontSubsetFlags subsetFlags)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CompactFonts(fonts As List(Of Font), ByRef indices As Integer(), ByRef mergedFonts As Byte()(), subsetFlags As FontSubsetFlags) As Boolean</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.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 list of source font subsets.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>[]</td>
      <td><span class="parametername">indices</span></td>
      <td><p>OUT: an array of indices mapping source font indices to merged font indices. 0 indicates non-merged fonts.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[][]</td>
      <td><span class="parametername">mergedFonts</span></td>
      <td><p>OUT: an array containing binary data of merged fonts. <b>mergedFonts[0]</b> is always <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Text.FontSubsetFlags.html">FontSubsetFlags</a></td>
      <td><span class="parametername">subsetFlags</span></td>
      <td><p>Font serialization flags.</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.boolean">bool</a></td>
      <td><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if some fonts were merged, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a> otherwise.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
