Open
Description
When I started using Hugo, I was really drawn to the "images.Text" feature.
I'm trying to use this to generate images for the Open Graph Protocol.
Since it does not support CJK, it is in a state where it is not wrapped as shown below.
{{- $font := resources.Get "/fonts/NotoSansJP-Bold.ttf" -}}
{{- $img_base := resources.Get "/img/ogp.png" -}}
{{- $img_base = $img_base.Filter (images.Text "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみぬめもあいうえおかきくけこさしすせそたちつてとなにぬねの" (
dict
"color" "#ffffff"
"size" 60
"linespacing" 2
"x" 130
"y" 220
"font" $font
)
)
-}}
Workaround
As a workaround, it can be handled by separating with spaces at moderate intervals, but I thought it would be easier to use if you could define a text area like a CSS margin.
Could you consider adding it as a feature?
- Avoidance example
{{- $img_base = $img_base.Filter (images.Text "あいうえおかきくけこさしすせそ たちつてとなにぬねのはひふへほ まみぬめもあいうえおかきくけ こさしすせそたちつてとなにぬねの" (
dict
"color" "#ffffff"
"size" 60
"linespacing" 2
"x" 130
"y" 220
"font" $font
)
)
-}}