Text to caption/pango with several font options
Posted: 2016-10-17T14:21:17-07:00
Hi,
I'm trying to make an image of several words (hundreds), which may be on a file (separated by spaces)
For that purpose I'm using this command (which works very well)
convert -background lightblue -fill blue -font justbeautifulsimplicity -gravity center -size 4500x3000 caption:@/tmp/list_of_words.txt out.png
But now I want to alternate some font properties for the words. For example, alternate foreground color like this:
Firstword(fgcolor=red) Secondword(fgcolor=blue) Thirdword(fgcolor=red) Fourthword(fgcolor=blue) and so on and so forth.
I tried to use pango format like this:
convert -background lightblue -fill blue -font justbeautifulsimplicity -gravity center -size 4500x3000 pango:@/tmp/somepangofile.txt out.png
and doig some <span foreground="red"> on the file.
So the color changing is working now, but the problem here is that the text is not justified and the font size is not selected according to the size of the image.
Is there a way to accomplish this?
Thanks in advance,
Best regards.
I'm trying to make an image of several words (hundreds), which may be on a file (separated by spaces)
For that purpose I'm using this command (which works very well)
convert -background lightblue -fill blue -font justbeautifulsimplicity -gravity center -size 4500x3000 caption:@/tmp/list_of_words.txt out.png
But now I want to alternate some font properties for the words. For example, alternate foreground color like this:
Firstword(fgcolor=red) Secondword(fgcolor=blue) Thirdword(fgcolor=red) Fourthword(fgcolor=blue) and so on and so forth.
I tried to use pango format like this:
convert -background lightblue -fill blue -font justbeautifulsimplicity -gravity center -size 4500x3000 pango:@/tmp/somepangofile.txt out.png
and doig some <span foreground="red"> on the file.
So the color changing is working now, but the problem here is that the text is not justified and the font size is not selected according to the size of the image.
Is there a way to accomplish this?
Thanks in advance,
Best regards.