---
title: "Font..::.MeasureFormattedText Method (String, Int32, Int32, Boolean, Int32)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_Font_MeasureFormattedText_5_f6eb3a39.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.MeasureFormattedText Method (String, Int32, Int32, Boolean, Int32)
 
Gets extent of the given formatted text (both width and height) when it will be drawn with the [GdiGraphics.DrawFormattedText](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawFormattedText.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 MeasureFormattedText ( _text As String, _width As Integer, _height As Integer, _clipping As Boolean, _tabSize As Integer _
) As SizeF
```
 
```csharp
public SizeF MeasureFormattedText(string text,int width,int height,bool clipping,int tabSize
)
```
 
### Parameters
 
 - text
     - Type: [System.String](http://msdn2.microsoft.com/en-us/s1wwdcbf)
Multiline formatted text you want to measure.

 - width
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Width of the destination rectangle.

 - height
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
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 formatted text when it will be drawn.
 
## Remarks
  
Width and height parameters specify 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.DrawFormattedText](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawFormattedText.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)
- [MeasureFormattedText Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_Font_MeasureFormattedText.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
- [GdiGraphics.DrawFormattedText()](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawFormattedText.htm.md)

### Manual

- [Measuring Text Size](https://www.graphicsmill.com/docs/gm5/MeasuringTextSize.htm.md)
