I needed to render some RTL Arabic text. I tried gd2 and ImageMagick without luck as they they seem to use freetype, kept trying to find a work arround, by flipping words, or using different fonts, but without luck, until I learned about pango-view.

so I gave pango, pango-view a try.

Install it:
on linux, you can use yum or dpkg.
on Mac OS, I used macports, sudo port install pango.

Try it:
Create a text file with some Arabic content, for example “letter.txt”
run the command:

pango-view letters.txt --background=transparent -q -o letters.png

If every thing ran smoothly, you will get something like this.

arabic letter generated using pango-view

Good luck with pango-view