# GrapeCity.Spreadsheet.Printing.PrintingContext.MeasureText

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Printing_PrintingContext_MeasureText_" data-uid="GrapeCity.Spreadsheet.Printing.PrintingContext.MeasureText*">MeasureText Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Printing_PrintingContext_MeasureText_" data-uid="GrapeCity.Spreadsheet.Printing.PrintingContext.MeasureText*"></a>
<h4 id="GrapeCity_Spreadsheet_Printing_PrintingContext_MeasureText_System_String_GrapeCity_Spreadsheet_Font_GrapeCity_Drawing_Size_System_Boolean_" data-uid="GrapeCity.Spreadsheet.Printing.PrintingContext.MeasureText(System.String,GrapeCity.Spreadsheet.Font,GrapeCity.Drawing.Size,System.Boolean)">MeasureText(string, Font, Size, bool)</h4>
<div class="markdown level1 summary"><p>Measures the specified text string when drawn with the specified <span class="xref">GrapeCity.Spreadsheet.Font</span>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public abstract Size MeasureText(string text, Font font, Size limitSize = default, bool wrapText = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public MustOverride Function MeasureText(text As String, font As Font, Optional limitSize As Size = Nothing, Optional wrapText As Boolean = False) As Size</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 string to measures.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">Font</span></td>
      <td><span class="parametername">font</span></td>
      <td><p><span class="xref">GrapeCity.Spreadsheet.Font</span> that defines the text format of the string.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">Size</span></td>
      <td><span class="parametername">limitSize</span></td>
      <td><p>The limit size.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">wrapText</span></td>
      <td><p>The wrapText</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><span class="xref">Size</span></td>
      <td><p>A <span class="xref">GrapeCity.Drawing.Size</span> object.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
