# C1.C1Preview.EmbeddedFontCollection.FindBestMatch

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Preview_EmbeddedFontCollection_FindBestMatch_" data-uid="C1.C1Preview.EmbeddedFontCollection.FindBestMatch*">FindBestMatch Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Preview_EmbeddedFontCollection_FindBestMatch_" data-uid="C1.C1Preview.EmbeddedFontCollection.FindBestMatch*"></a>
<h4 id="C1_C1Preview_EmbeddedFontCollection_FindBestMatch_System_String_System_Int32_System_Drawing_FontStyle_" data-uid="C1.C1Preview.EmbeddedFontCollection.FindBestMatch(System.String,System.Int32,System.Drawing.FontStyle)">FindBestMatch(string, int, FontStyle)</h4>
<div class="markdown level1 summary"><p>Searches for a font with the specified name and charset,
which is the best match for the specified bold/italic styles
(exact bold/italic matching is not guaranteed by this method).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public EmbeddedFont FindBestMatch(string name, int charSet, FontStyle fontStyle)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function FindBestMatch(name As String, charSet As Integer, fontStyle As FontStyle) As EmbeddedFont</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">name</span></td>
      <td><p>The name of the font to search for.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">charSet</span></td>
      <td><p>The charset to search for.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.fontstyle">FontStyle</a></td>
      <td><span class="parametername">fontStyle</span></td>
      <td><p>The style of the font to match.</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="C1.C1Preview.EmbeddedFont.html">EmbeddedFont</a></td>
      <td><p>The matching <a class="xref" href="C1.C1Preview.EmbeddedFont.html">EmbeddedFont</a>, or <b>null</b> if a match could not be found.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
