mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 20:17:17 +00:00
images: Text filter that draws text with the given options (#9239)
Fixes #9238
This commit is contained in:
1 parent
424f219ebc
commit
3186e6458d
1 file changed
+21
@@ -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`).
|
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
|
### Brightness
|
||||||
|
|
||||||
{{% funcsig %}}
|
{{% funcsig %}}
|
||||||
|
|||||||
Reference in new issue
Block a user