# C1.Util.FontSubSet.MeasureText

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_FontSubSet_MeasureText_" data-uid="C1.Util.FontSubSet.MeasureText*">MeasureText Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_FontSubSet_MeasureText_" data-uid="C1.Util.FontSubSet.MeasureText*"></a>
<h4 id="C1_Util_FontSubSet_MeasureText_System_String_System_Boolean_System_Int32__System_Int32__System_Int32_" data-uid="C1.Util.FontSubSet.MeasureText(System.String,System.Boolean,System.Int32@,System.Int32@,System.Int32)">MeasureText(string, bool, out int, out int, int)</h4>
<div class="markdown level1 summary"><p>Measure text for this font subset.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int MeasureText(string text, bool vertical, out int width, out int height, int defaultWidth = 1000)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureText(text As String, vertical As Boolean, ByRef width As Integer, ByRef height As Integer, Optional defaultWidth As Integer = 1000) As Integer</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">text</span></td>
      <td><p>The text string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">vertical</span></td>
      <td><p>Whether using a vertical font.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>Output calculated width of the text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>Output calculated height of the text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">defaultWidth</span></td>
      <td><p>The default width of some character.</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.int32">int</a></td>
      <td><p>If calculated then return <b>true</b>, otherwise <b>false</b>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_FontSubSet_MeasureText_" data-uid="C1.Util.FontSubSet.MeasureText*"></a>
<h4 id="C1_Util_FontSubSet_MeasureText_System_String_System_Boolean_System_Int32__System_Int32__System_Int32____System_Int32_" data-uid="C1.Util.FontSubSet.MeasureText(System.String,System.Boolean,System.Int32@,System.Int32@,System.Int32[]@,System.Int32)">MeasureText(string, bool, out int, out int, out int[], int)</h4>
<div class="markdown level1 summary"><p>Measure text for this font subset.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int MeasureText(string text, bool vertical, out int width, out int height, out int[] charWidths, int defaultWidth = 1000)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureText(text As String, vertical As Boolean, ByRef width As Integer, ByRef height As Integer, ByRef charWidths As Integer(), Optional defaultWidth As Integer = 1000) As Integer</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">text</span></td>
      <td><p>The text string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">vertical</span></td>
      <td><p>Whether using a vertical font.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>Output calculated width of the text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>Output calculated height of the text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>[]</td>
      <td><span class="parametername">charWidths</span></td>
      <td><p>Output calculated widths for each character.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">defaultWidth</span></td>
      <td><p>The default width of some character.</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.int32">int</a></td>
      <td><p>If calculated then return <b>true</b>, otherwise <b>false</b>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
