From 283394a4fde14476db576a15b7bcc472d693d76f Mon Sep 17 00:00:00 2001 From: Paul van Brouwershaven Date: Tue, 7 Dec 2021 11:29:55 +0100 Subject: images: Text filter that draws text with the given options (#9239) Fixes #9238 --- docs/content/en/functions/images/index.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'docs/content/en') 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 %}} -- cgit v1.2.3