# Text

Write text to the image.

## Parameters

<table><thead><tr><th width="198.4826833846656">Parameter</th><th width="208.18338610093963">Type</th><th>Description</th></tr></thead><tbody><tr><td>label</td><td><code>string</code></td><td>Text content.</td></tr><tr><td>x</td><td><code>int</code></td><td>X-Coordinate of the top-left corner of the text.</td></tr><tr><td>y</td><td><code>int</code></td><td>Y-Coordinate of the top-left corner of the text.</td></tr><tr><td>fontPath</td><td><code>string</code></td><td>Filepath of the font.</td></tr><tr><td>fontColor</td><td><code>color.Color</code></td><td>Color of the text.</td></tr><tr><td>fontSize</td><td><code>float64</code></td><td>Size of the text.</td></tr><tr><td>dpi</td><td><code>float64</code></td><td>DPI of the text.</td></tr></tbody></table>

## Return Values

The instance of `*imgo.Image` .

## Examples

```go
package main

import (
    "github.com/fishtailstudio/imgo"
    "golang.org/x/image/colornames"
    "image/color"
)

func main() {
    fontPath := "/System/Library/Fonts/Supplemental/Arial.ttf"
    imgo.Canvas(500, 500, color.White).
        Text("Hello World", 50, 50, fontPath, colornames.Chocolate, 50, 100).
        Save("out.png")
}
```
