---
title: "Text.FitTo Method "
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Drawing_Text_FitTo_4_e0d596b2.htm
archived: false
applies_to:
  - product: "Graphics Mill"
    versions: ["12.1", "6.x-12.x (may differ)"]
    entity_id: "https://www.graphicsmill.com/#software-application"
---

# Text.FitTo Method 

**Applies to:** Graphics Mill 12.1, 6.x-12.x (may differ)
 
Configures text settings to fit the text to the given rectangle.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Drawing.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public void FitTo(RectangleF rect,FontRegistry fontRegistry,float dpiX,float dpiY
)
```
 
### Parameters
 
 - rect
     - Type: System.Drawing.RectangleF
The rectangle to fit text to.

 - fontRegistry
     - Type: [Aurigma.GraphicsMill.Drawing.FontRegistry](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_FontRegistry.htm.md)
The [FontRegistry](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_FontRegistry.htm.md) to create this text for.

 - dpiX
     - Type: System.Single
The horizontal resolution of the [Text](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Text.htm.md) in DPI.

 - dpiY
     - Type: System.Single
The vertical resolution of the [Text](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Text.htm.md) in DPI.
   
## See Also

### Reference

- [Text Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Drawing_Text.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Drawing.htm.md)
