我有这个脚本,可以将文本写入图像。
echo \\n"List? {y/n}"
read cont
if
[ "$cont" = "y" ] || [ "$cont" = "Y" ]
then
rm -rf sponsors.txt
ls *.jpg *.png *.gif -1 > sponsors2.txt
while read line
do
echo " >$line" >> sponsors.txt
done < sponsors2.txt
fi
read -p "$pause" "Press [Enter] key to start..."
while IFS='>' read field1 field2 ; do
convert -pointsize 18 -font /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf -fill white -stroke black -strokewidth 1 -draw "text 1, 35 '$field1'" $field2 done/$field2
done < sponsors.txt
rm -rf sponsors2.txt
问题是自动换行。有些行太长了。我知道转换是个问题。
答案1
查看ImageMagick 文档中的标题选项. 它解释了如何进行自动换行。