---
title: "Font..::.MeasureText Method (String, Size, Boolean, Int32)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_Font_MeasureText_4_c7e309a5.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# Font.MeasureText Method (String, Size, Boolean, Int32)
 
Gets extent of the given text (both width and height) when it will be drawn with the [GdiGraphics.DrawText](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawText.htm.md) method.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Function MeasureText ( _text As String, _size As Size, _clipping As Boolean, _tabSize As Integer _
) As SizeF
```
 
```csharp
public SizeF MeasureText(string text,Size size,bool clipping,int tabSize
)
```
 
### Parameters
 
 - text
     - Type: [System.String](http://msdn2.microsoft.com/en-us/s1wwdcbf)
Multiline text you want to measure.

 - size
     - Type: [System.Drawing.Size](http://msdn2.microsoft.com/en-us/bfwt6fe5)
Width and height of the destination rectangle.

 - clipping
     - Type: [System.Boolean](http://msdn2.microsoft.com/en-us/a28wyd50)
Value specifying whether to take into account the destination rectangle. If this value is **false** the whole text is processed, otherwise only the part which fits the destination rectangle will be measured.

 - tabSize
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Value which specifies the number of whitespaces to replace one tabulation character in the text.
 
### Return Value
Dimensions of the rectangle occupied with text when it will be drawn.
 
## Remarks
  
Size parameter specifies the desired rectangle you want to display the text inside. The return value is the actual dimensions of the rectangle the text will occupy when displaying.
 
To get a valid text size, parameters values passed to this method should be identical to the respective parameters of the [GdiGraphics.DrawText](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawText.htm.md) method.
 
All the coordinates are measured in units specified with [Unit](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_UnitConverterObject_Unit.htm.md) property.
   
## See Also

### Reference

- [Font Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_Font.htm.md)
- [MeasureText Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_Font_MeasureText.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
- [GdiGraphics.DrawText()](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawText.htm.md)

### Manual

- [Measuring Text Size](https://www.graphicsmill.com/docs/gm5/MeasuringTextSize.htm.md)
