# C1.Util.DX.DirectWrite.Factory.RegisterFontCollectionLoader

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_Factory_RegisterFontCollectionLoader_" data-uid="C1.Util.DX.DirectWrite.Factory.RegisterFontCollectionLoader*">RegisterFontCollectionLoader Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_Factory_RegisterFontCollectionLoader_" data-uid="C1.Util.DX.DirectWrite.Factory.RegisterFontCollectionLoader*"></a>
<h4 id="C1_Util_DX_DirectWrite_Factory_RegisterFontCollectionLoader_C1_Util_DX_DirectWrite_FontCollectionLoader_" data-uid="C1.Util.DX.DirectWrite.Factory.RegisterFontCollectionLoader(C1.Util.DX.DirectWrite.FontCollectionLoader)">RegisterFontCollectionLoader(FontCollectionLoader)</h4>
<div class="markdown level1 summary"><p>Registers a custom font collection loader with the factory object.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void RegisterFontCollectionLoader(FontCollectionLoader fontCollectionLoader)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub RegisterFontCollectionLoader(fontCollectionLoader As FontCollectionLoader)</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.FontCollectionLoader.html">FontCollectionLoader</a></td>
      <td><span class="parametername">fontCollectionLoader</span></td>
      <td><p>Reference to a <a class="xref" href="C1.Util.DX.DirectWrite.FontCollectionLoader.html">FontCollectionLoader</a> object to be registered.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DirectWrite_Factory_RegisterFontCollectionLoader_C1_Util_DX_DirectWrite_FontCollectionLoader__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This function registers a font collection loader with DirectWrite. The font collection loader interface, which should be implemented by a singleton object, handles enumerating font files in a font collection given a particular type of key. A given instance can only be registered once. Succeeding attempts will return an error, indicating that it has already been registered. Note that font file loader implementations must not register themselves with DirectWrite inside their constructors, and must not unregister themselves inside their destructors, because registration and unregistraton operations increment and decrement the object reference count respectively. Instead, registration and unregistration with DirectWrite of font file loaders should be performed outside of the font file loader implementation.</p>
</div>
</div>
