You may have noticed that there are some limitations for text space in the previous scripts. On the other hand we have to obey the specified text size and length and number of lines specified earlier on in those workshops.
Is it possible to implement a mechanism in which the input text understands the space it has and makes any necessary changes in the size or break itself as a multi-line phrase? Yes it is possible. We just need to change the ImageMagick commands.
In the current commands we set a specific number of lines and used the -pointsize
option to fix the size of input texts so that it fits into specific areas of our images.
Another alternative is using the -size
and -caption
options. For example, we can set the typing area as follows:
convert -background lightgray -size 70x120 caption:"here it is a long text" textfit.png
As you see a 120 pixel wide area is defined for the text and can be shown as follows:
So if the...