# FarPoint.Win.Text.TextHelper.Measure

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_Text_TextHelper_Measure_" data-uid="FarPoint.Win.Text.TextHelper.Measure*">Measure Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_Text_TextHelper_Measure_" data-uid="FarPoint.Win.Text.TextHelper.Measure*"></a>
<h4 id="FarPoint_Win_Text_TextHelper_Measure_System_Drawing_Graphics_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_RectangleF_FarPoint_Win_HorizontalAlignment_FarPoint_Win_VerticalAlignment_FarPoint_Win_TextOrientation_System_Boolean_System_Boolean_System_Drawing_Text_HotkeyPrefix_System_Drawing_StringTrimming_System_Int32_System_Boolean_System_Double_System_Int32_" data-uid="FarPoint.Win.Text.TextHelper.Measure(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.RectangleF,FarPoint.Win.HorizontalAlignment,FarPoint.Win.VerticalAlignment,FarPoint.Win.TextOrientation,System.Boolean,System.Boolean,System.Drawing.Text.HotkeyPrefix,System.Drawing.StringTrimming,System.Int32,System.Boolean,System.Double,System.Int32)">Measure(Graphics, string, Font, Color, RectangleF, HorizontalAlignment, VerticalAlignment, TextOrientation, bool, bool, HotkeyPrefix, StringTrimming, int, bool, double, int)</h4>
<div class="markdown level1 summary"><p>Determines the size of the text.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static SizeF Measure(Graphics g, string s, Font font, Color foreColor, RectangleF rectangle, HorizontalAlignment halign, VerticalAlignment valign, TextOrientation textOrientation, bool wordWrap, bool multiline, HotkeyPrefix hotkeyPrefix, StringTrimming stringTrim, int drawRectHeight, bool adjust, double rotationAngle, int textIndent)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Measure(g As Graphics, s As String, font As Font, foreColor As Color, rectangle As RectangleF, halign As HorizontalAlignment, valign As VerticalAlignment, textOrientation As TextOrientation, wordWrap As Boolean, multiline As Boolean, hotkeyPrefix As HotkeyPrefix, stringTrim As StringTrimming, drawRectHeight As Integer, adjust As Boolean, rotationAngle As Double, textIndent As Integer) 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.drawing.graphics">Graphics</a></td>
      <td><span class="parametername">g</span></td>
      <td><p>Graphics device interface for measuring the text on</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">s</span></td>
      <td><p>Text to measure</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>Font of the text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a></td>
      <td><span class="parametername">foreColor</span></td>
      <td><p>Color of the text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rectangle</span></td>
      <td><p>Bounding rectangle of the text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.HorizontalAlignment.html">HorizontalAlignment</a></td>
      <td><span class="parametername">halign</span></td>
      <td><p>Horizontal alignment settings of the text relative to its bounding rectangle</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.VerticalAlignment.html">VerticalAlignment</a></td>
      <td><span class="parametername">valign</span></td>
      <td><p>Vertical alignment settings of the text relative to its bounding rectangle</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.TextOrientation.html">TextOrientation</a></td>
      <td><span class="parametername">textOrientation</span></td>
      <td><p>Orientation of the text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">wordWrap</span></td>
      <td><p>Whether the text is wrapped to multiple lines</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">multiline</span></td>
      <td><p>Whether multiple lines are allowed</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.text.hotkeyprefix">HotkeyPrefix</a></td>
      <td><span class="parametername">hotkeyPrefix</span></td>
      <td><p>Hotkey prefix</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringtrimming">StringTrimming</a></td>
      <td><span class="parametername">stringTrim</span></td>
      <td><p>Trimming effect 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">drawRectHeight</span></td>
      <td><p>Height of the rectangle</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">adjust</span></td>
      <td><p>Whether to adjust the bounding rectangle of the text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">rotationAngle</span></td>
      <td><p>Rotation angle 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">textIndent</span></td>
      <td><p>Number of pixels to indent the text</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></td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Text_TextHelper_Measure_" data-uid="FarPoint.Win.Text.TextHelper.Measure*"></a>
<h4 id="FarPoint_Win_Text_TextHelper_Measure_FarPoint_Win_Text_DrawTextArgs_" data-uid="FarPoint.Win.Text.TextHelper.Measure(FarPoint.Win.Text.DrawTextArgs)">Measure(DrawTextArgs)</h4>
<div class="markdown level1 summary"><p>Determines the size of the text.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static SizeF Measure(DrawTextArgs args)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Measure(args As DrawTextArgs) 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="FarPoint.Win.Text.DrawTextArgs.html">DrawTextArgs</a></td>
      <td><span class="parametername">args</span></td>
      <td><p>Draw Text arguments</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></td>
    </tr>
  </tbody>
</table>
</div>
