# GrapeCity.ActiveReports.Drawing.TextMetricsProviderExtensions.MeasureString

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Drawing_TextMetricsProviderExtensions_MeasureString_" data-uid="GrapeCity.ActiveReports.Drawing.TextMetricsProviderExtensions.MeasureString*">MeasureString Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Drawing_TextMetricsProviderExtensions_MeasureString_" data-uid="GrapeCity.ActiveReports.Drawing.TextMetricsProviderExtensions.MeasureString*"></a>
<h4 id="GrapeCity_ActiveReports_Drawing_TextMetricsProviderExtensions_MeasureString_GrapeCity_ActiveReports_Drawing_ITextMetricsProvider_GrapeCity_ActiveReports_Drawing_FontInfo_System_String_GrapeCity_ActiveReports_Extensibility_Rendering_Components_IStyle_System_Single_System_Single_System_Globalization_CultureInfo_" data-uid="GrapeCity.ActiveReports.Drawing.TextMetricsProviderExtensions.MeasureString(GrapeCity.ActiveReports.Drawing.ITextMetricsProvider,GrapeCity.ActiveReports.Drawing.FontInfo,System.String,GrapeCity.ActiveReports.Extensibility.Rendering.Components.IStyle,System.Single,System.Single,System.Globalization.CultureInfo)">MeasureString(ITextMetricsProvider, FontInfo, string, IStyle, float, float, CultureInfo)</h4>
<div class="markdown level1 summary"><p>Measures string content based on currently selected font, device capabilities and <a class="xref" href="GrapeCity.ActiveReports.Extensibility.Rendering.Components.IStyle.html">IStyle</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static TextMetrics MeasureString(this ITextMetricsProvider tm, FontInfo font, string contentText, IStyle style, float boundWidth, float boundHeight, CultureInfo reportCulture = null)</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="GrapeCity.ActiveReports.Drawing.ITextMetricsProvider.html">ITextMetricsProvider</a></td>
      <td><span class="parametername">tm</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.Drawing.FontInfo.html">FontInfo</a></td>
      <td><span class="parametername">font</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">contentText</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.Extensibility.Rendering.Components.IStyle.html">IStyle</a></td>
      <td><span class="parametername">style</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">boundWidth</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">boundHeight</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a></td>
      <td><span class="parametername">reportCulture</span></td>
      <td></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="GrapeCity.ActiveReports.Drawing.TextMetrics.html">TextMetrics</a></td>
      <td><p>Number of characters fit into provided bounds</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_Drawing_TextMetricsProviderExtensions_MeasureString_" data-uid="GrapeCity.ActiveReports.Drawing.TextMetricsProviderExtensions.MeasureString*"></a>
<h4 id="GrapeCity_ActiveReports_Drawing_TextMetricsProviderExtensions_MeasureString_GrapeCity_ActiveReports_Drawing_ITextMetricsProvider_GrapeCity_ActiveReports_Drawing_FontInfo_System_String_GrapeCity_ActiveReports_Extensibility_Rendering_Components_IStyle_GrapeCity_ActiveReports_Drawing_StringFormatEx_System_Single_System_Single_System_Globalization_CultureInfo_" data-uid="GrapeCity.ActiveReports.Drawing.TextMetricsProviderExtensions.MeasureString(GrapeCity.ActiveReports.Drawing.ITextMetricsProvider,GrapeCity.ActiveReports.Drawing.FontInfo,System.String,GrapeCity.ActiveReports.Extensibility.Rendering.Components.IStyle,GrapeCity.ActiveReports.Drawing.StringFormatEx,System.Single,System.Single,System.Globalization.CultureInfo)">MeasureString(ITextMetricsProvider, FontInfo, string, IStyle, StringFormatEx, float, float, CultureInfo)</h4>
<div class="markdown level1 summary"><p>Measures string content based on currently selected font, device capabilities, string format and <a class="xref" href="GrapeCity.ActiveReports.Extensibility.Rendering.Components.IStyle.html">IStyle</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static TextMetrics MeasureString(this ITextMetricsProvider tm, FontInfo font, string contentText, IStyle style, StringFormatEx stringFormat, float boundWidth = 3.4028235E+38, float boundHeight = 3.4028235E+38, CultureInfo reportCulture = null)</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="GrapeCity.ActiveReports.Drawing.ITextMetricsProvider.html">ITextMetricsProvider</a></td>
      <td><span class="parametername">tm</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.Drawing.FontInfo.html">FontInfo</a></td>
      <td><span class="parametername">font</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">contentText</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.Extensibility.Rendering.Components.IStyle.html">IStyle</a></td>
      <td><span class="parametername">style</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.Drawing.StringFormatEx.html">StringFormatEx</a></td>
      <td><span class="parametername">stringFormat</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">boundWidth</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">boundHeight</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a></td>
      <td><span class="parametername">reportCulture</span></td>
      <td></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="GrapeCity.ActiveReports.Drawing.TextMetrics.html">TextMetrics</a></td>
      <td><p>Number of characters fit into provided bounds</p>
</td>
    </tr>
  </tbody>
</table>
</div>
