# C1.Util.DX.DirectWrite.GdiInterop.ToLogFont

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_GdiInterop_ToLogFont_" data-uid="C1.Util.DX.DirectWrite.GdiInterop.ToLogFont*">ToLogFont Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_GdiInterop_ToLogFont_" data-uid="C1.Util.DX.DirectWrite.GdiInterop.ToLogFont*"></a>
<h4 id="C1_Util_DX_DirectWrite_GdiInterop_ToLogFont_C1_Util_DX_DirectWrite_Font_System_Object_" data-uid="C1.Util.DX.DirectWrite.GdiInterop.ToLogFont(C1.Util.DX.DirectWrite.Font,System.Object)">ToLogFont(Font, object)</h4>
<div class="markdown level1 summary"><p>Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool ToLogFont(Font font, object logFont)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function ToLogFont(font As Font, logFont As Object) 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="C1.Util.DX.DirectWrite.Font.html">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>An <a class="xref" href="C1.Util.DX.DirectWrite.Font.html">Font</a> object to be converted into a GDI-compatible LOGFONT structure.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">logFont</span></td>
      <td><p>When this method returns, contains a structure that receives a GDI-compatible font description.</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>TRUE if the specified font object is part of the system font collection; otherwise, FALSE.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DirectWrite_GdiInterop_ToLogFont_C1_Util_DX_DirectWrite_Font_System_Object__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The conversion to a  LOGFONT by using ConvertFontToLOGFONT operates at the logical font level and does not guarantee that it will map to a specific physical font. It is not guaranteed that GDI will select the same physical font for displaying  text formatted by a LOGFONT as the <a class="xref" href="C1.Util.DX.DirectWrite.Font.html">Font</a> object that was converted.</p>
</div>
</div>
