views:

291

answers:

2

Hi, I need to convert text to an image. Using imagemagick I can get this done. However, part or all of the text could be in Hebrew (an RTL language). This means the words in Hebrew are rendered backwards. If I was assured that the text was only Hebrew, I would have just reversed the text before sending it to ImageMagick. However, this solution won't work if part of the text is in English.

Does anyone have any idea how this can be done?

P.S. I'm not committed to using ImageMagick, if a better way comes up. However, the solution should work for both Linux and Windows (I might be able to live with a non-windows solution, but a multi OS solution is preferable).

Thanks, Niv

+1  A: 

Sounds like your real issue is to re-order the bidirectional text for imagemagick. A job for the Unicode bidirectional algorithm. See http://unicode.org/reports/tr9/ That report lists two reference implementations. Or see this one: http://fribidi.org/

Larry K