# C1.Util.DX.DirectWrite.FontFace.GetGdiCompatibleGlyphMetrics

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DirectWrite_FontFace_GetGdiCompatibleGlyphMetrics_" data-uid="C1.Util.DX.DirectWrite.FontFace.GetGdiCompatibleGlyphMetrics*">GetGdiCompatibleGlyphMetrics Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DirectWrite_FontFace_GetGdiCompatibleGlyphMetrics_" data-uid="C1.Util.DX.DirectWrite.FontFace.GetGdiCompatibleGlyphMetrics*"></a>
<h4 id="C1_Util_DX_DirectWrite_FontFace_GetGdiCompatibleGlyphMetrics_System_Single_System_Single_System_Nullable_C1_Util_DX_Matrix3x2__System_Boolean_System_Int16___System_Boolean_" data-uid="C1.Util.DX.DirectWrite.FontFace.GetGdiCompatibleGlyphMetrics(System.Single,System.Single,System.Nullable{C1.Util.DX.Matrix3x2},System.Boolean,System.Int16[],System.Boolean)">GetGdiCompatibleGlyphMetrics(float, float, Matrix3x2?, bool, short[], bool)</h4>
<div class="markdown level1 summary"><p>Obtains glyph metrics in font design units with the return values compatible with what GDI would produce.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public GlyphMetrics[] GetGdiCompatibleGlyphMetrics(float fontSize, float pixelsPerDip, Matrix3x2? transform, bool useGdiNatural, short[] glyphIndices, bool isSideways)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetGdiCompatibleGlyphMetrics(fontSize As Single, pixelsPerDip As Single, transform As Matrix3x2?, useGdiNatural As Boolean, glyphIndices As Short(), isSideways As Boolean) As GlyphMetrics()</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.single">float</a></td>
      <td><span class="parametername">fontSize</span></td>
      <td><p>The ogical size of the font in DIP units.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">pixelsPerDip</span></td>
      <td><p>The number of physical pixels per DIP.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Matrix3x2.html">Matrix3x2</a>?</td>
      <td><span class="parametername">transform</span></td>
      <td><p>An optional transform applied to the glyphs and their positions. This transform is applied after the scaling specified by the font size and pixelsPerDip.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">useGdiNatural</span></td>
      <td><p>When set to FALSE, the metrics are the same as the metrics of GDI aliased text.  When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font created with CLEARTYPE_NATURAL_QUALITY.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int16">short</a>[]</td>
      <td><span class="parametername">glyphIndices</span></td>
      <td><p>An array of glyph indices for which to compute the metrics.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">isSideways</span></td>
      <td><p>A BOOL value that indicates whether the font is being used in a sideways run.  This can affect the glyph metrics if the font has oblique simulation because sideways oblique simulation differs from non-sideways oblique simulation.</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.Util.DX.DirectWrite.GlyphMetrics.html">GlyphMetrics</a>[]</td>
      <td><p>An array of <span class="xref">C1.Win.DX.DirectWrite.GlyphMetrics</span> structures filled by this function. The metrics are in font design units.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DirectWrite_FontFace_GetGdiCompatibleGlyphMetrics_" data-uid="C1.Util.DX.DirectWrite.FontFace.GetGdiCompatibleGlyphMetrics*"></a>
<h4 id="C1_Util_DX_DirectWrite_FontFace_GetGdiCompatibleGlyphMetrics_System_Single_System_Single_System_Nullable_C1_Util_DX_Matrix3x2__C1_Util_DX_Bool_System_Int16___System_Int32_C1_Util_DX_DirectWrite_GlyphMetrics___C1_Util_DX_Bool_" data-uid="C1.Util.DX.DirectWrite.FontFace.GetGdiCompatibleGlyphMetrics(System.Single,System.Single,System.Nullable{C1.Util.DX.Matrix3x2},C1.Util.DX.Bool,System.Int16[],System.Int32,C1.Util.DX.DirectWrite.GlyphMetrics[],C1.Util.DX.Bool)">GetGdiCompatibleGlyphMetrics(float, float, Matrix3x2?, Bool, short[], int, GlyphMetrics[], Bool)</h4>
<div class="markdown level1 summary"><p>HRESULT IDWriteFontFace::GetGdiCompatibleGlyphMetrics([In] float emSize,[In] float pixelsPerDip,[In, Optional] const DWRITE_MATRIX* transform,[In] BOOL useGdiNatural,[In, Buffer] const unsigned short* glyphIndices,[In] unsigned int glyphCount,[Out, Buffer] DWRITE_GLYPH_METRICS* glyphMetrics,[In] BOOL isSideways)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void GetGdiCompatibleGlyphMetrics(float emSize, float pixelsPerDip, Matrix3x2? transform, Bool useGdiNatural, short[] glyphIndices, int glyphCount, GlyphMetrics[] glyphMetrics, Bool isSideways)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub GetGdiCompatibleGlyphMetrics(emSize As Single, pixelsPerDip As Single, transform As Matrix3x2?, useGdiNatural As Bool, glyphIndices As Short(), glyphCount As Integer, glyphMetrics As GlyphMetrics(), isSideways As Bool)</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.single">float</a></td>
      <td><span class="parametername">emSize</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">pixelsPerDip</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Matrix3x2.html">Matrix3x2</a>?</td>
      <td><span class="parametername">transform</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Bool.html">Bool</a></td>
      <td><span class="parametername">useGdiNatural</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int16">short</a>[]</td>
      <td><span class="parametername">glyphIndices</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">glyphCount</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DirectWrite.GlyphMetrics.html">GlyphMetrics</a>[]</td>
      <td><span class="parametername">glyphMetrics</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Bool.html">Bool</a></td>
      <td><span class="parametername">isSideways</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
