diff options
author | Paul van Brouwershaven <vanbroup@users.noreply.github.com> | 2021-12-07 11:29:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 11:29:55 +0100 |
commit | 283394a4fde14476db576a15b7bcc472d693d76f (patch) | |
tree | 6d3ed28edfaecb0ec70fedad4eba397a309a4c0b /docs/content/en/functions | |
parent | 5538507e9053a00faa358b92ad0bb004e8d28daf (diff) |
images: Text filter that draws text with the given options (#9239)
Fixes #9238
Diffstat (limited to 'docs/content/en/functions')
-rw-r--r-- | docs/content/en/functions/images/index.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/content/en/functions/images/index.md b/docs/content/en/functions/images/index.md index 5553aee92..274072dba 100644 --- a/docs/content/en/functions/images/index.md +++ b/docs/content/en/functions/images/index.md @@ -40,6 +40,27 @@ A shorter version of the above, if you only need to apply the filter once: The above will overlay `$logo` in the upper left corner of `$img` (at position `x=50, y=50`). +### Text + +Using the `Text` filter, you can add text to an image. + +{{% funcsig %}} +images.Text TEXT DICT) +{{% /funcsig %}} + +The following example will add the text `Hugo rocks!` to the image with the specified color, size and position. + +``` +{{ $img := resources.Get "/images/background.png"}} +{{ $img = $img.Filter (images.Text "Hugo rocks!" (dict + "color" "#ffffff" + "size" 60 + "linespacing" 2 + "x" 10 + "y" 20 +))}} +``` + ### Brightness {{% funcsig %}} |