You can use the following one liner to get the Google Web Font, that you need and then use it with imagemagick, subsequently:
wget -qO- 'https://fonts.googleapis.com/css?family=Noto+Sans:400' | grep -Eo 'http.*://[^ >]+' | sed 's/.ttf)/.ttf/' | wget -i - -O 'Noto Sans.ttf'
I then use the following script to generate text based thumbnails, with all my favorite ttf font files, copied to the same folder before:
ls -1 *.ttf | while read line
do
magick -gravity center -background '#086cdf' -fill '#f1fffe' -size 490x400 -font "$line" caption:"Sample Text" -background red -extent 500x500 "$(echo "$line"|sed 's/.ttf/_icon.png/')"
done
The above script generates icon sized thumbnails with size of 500x500 pixels.
For social media platforms like youtube, thumbnails must be of size 1280x720 for which i use the following script, to generate it:
ls -1 *.ttf | while read line
do
magick -gravity center -background '#086cdf' -fill '#f1fffe' -size 1270x620 -font "$line" caption:"Sample Text" -background red -extent 1280x720 "$(echo "$line"|sed 's/.ttf/_Social_Media_Platforms.png/')"
done
Hope all these scripts help someone googling for a solution.
-font
to point to a file like-font ./myfont.ttf
? – Incumbency