This is a ruby script to generate png image from text (pango markups.)
- Install
ruby
,ruby-pango
from the repository.
$ sudo apt-get install ruby ruby-pango
- Create a text file containing corresponding text/pango markup for each image to generate. See
examples
directory for example files.
$ cat noacct.txt
<span face="Ubuntu 12">No Account yet? Register <span foreground="blue"><u>here</u></span>!</span>
- Generate images
$ ./text2png.rb examples/*.txt
- Auto-crop and optimize images. (Must have
imagemagick
installed)
$ for image in *.png; do convert "$image" -trim -strip -quality 86 "$image";done