# GrapeCity.Documents.Drawing.GcGraphics.MeasureStringWithTrailingWhitespace

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Drawing_GcGraphics_MeasureStringWithTrailingWhitespace_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.MeasureStringWithTrailingWhitespace*">MeasureStringWithTrailingWhitespace Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Drawing_GcGraphics_MeasureStringWithTrailingWhitespace_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.MeasureStringWithTrailingWhitespace*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcGraphics_MeasureStringWithTrailingWhitespace_System_String_GrapeCity_Documents_Text_Font_System_Single_System_Nullable_System_Single__" data-uid="GrapeCity.Documents.Drawing.GcGraphics.MeasureStringWithTrailingWhitespace(System.String,GrapeCity.Documents.Text.Font,System.Single,System.Nullable{System.Single})">MeasureStringWithTrailingWhitespace(string, Font, float, float?)</h4>
<div class="markdown level1 summary"><p>Measures a string using a specified font, font size and layout width, taking into account the trailing whitespace at the end of each line.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SizeF MeasureStringWithTrailingWhitespace(string text, Font font, float fontSize, float? width = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureStringWithTrailingWhitespace(text As String, font As Font, fontSize As Single, Optional width As Single? = Nothing) As SizeF</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 measure.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Text.Font.html">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>The font to use.</p>
</td>
    </tr>
    <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 font size to use.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a>?</td>
      <td><span class="parametername">width</span></td>
      <td><p>The width allocated to draw the string, or null to indicate unlimited width.</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.drawing.sizef">SizeF</a></td>
      <td><p>The size needed to draw the string with trailing whitespace.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Drawing_GcGraphics_MeasureStringWithTrailingWhitespace_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.MeasureStringWithTrailingWhitespace*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcGraphics_MeasureStringWithTrailingWhitespace_System_String_GrapeCity_Documents_Text_TextFormat_System_Nullable_System_Single__" data-uid="GrapeCity.Documents.Drawing.GcGraphics.MeasureStringWithTrailingWhitespace(System.String,GrapeCity.Documents.Text.TextFormat,System.Nullable{System.Single})">MeasureStringWithTrailingWhitespace(string, TextFormat, float?)</h4>
<div class="markdown level1 summary"><p>Measures a string using a specified <a class="xref" href="GrapeCity.Documents.Text.TextFormat.html">TextFormat</a>, taking into account the trailing whitespace at the end of each line.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SizeF MeasureStringWithTrailingWhitespace(string text, TextFormat textFormat, float? width = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureStringWithTrailingWhitespace(text As String, textFormat As TextFormat, Optional width As Single? = Nothing) As SizeF</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 measure.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Text.TextFormat.html">TextFormat</a></td>
      <td><span class="parametername">textFormat</span></td>
      <td><p>The text format to use.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a>?</td>
      <td><span class="parametername">width</span></td>
      <td><p>The width allocated to draw the string, or null to indicate unlimited width.</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.drawing.sizef">SizeF</a></td>
      <td><p>The size needed to draw the string with trailing whitespace.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
