使用imagemagick将希伯来文本转换为图像

时间:2021-11-17 01:51:34

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.

我需要将文本转换为图像。使用imagemagick我可以完成这个。但是,部分或全部文本可能是希伯来语(RTL语言)。这意味着希伯来语中的单词会向后呈现。如果我确信文本只是希伯来语,我会在将文本发送给ImageMagick之前将其翻转。但是,如果部分文本是英文,则此解决方案将不起作用。

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).

附:如果有更好的方法,我不会致力于使用ImageMagick。但是,该解决方案应该适用于Linux和Windows(我可能能够使用非Windows解决方案,但最好使用多操作系统解决方案)。

Thanks, Niv

2 个解决方案

#1


i see this link

我看到这个链接

http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Q_21766928.html

they suggest

Maybe Unifier (http://www.melody-soft.com/html/unifier.html) or Encoding Master (http://www.elfdata.com/encodingmaster/index.html)

也许Unifier(http://www.melody-soft.com/html/unifier.html)或编码大师(http://www.elfdata.com/encodingmaster/index.html)

#2


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/

听起来你真正的问题是为imagemagick重新排序双向文本。 Unicode双向算法的工作。请参阅http://unicode.org/reports/tr9/该报告列出了两个参考实现。或者看看这个:http://fribidi.org/

#1


i see this link

我看到这个链接

http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Q_21766928.html

they suggest

Maybe Unifier (http://www.melody-soft.com/html/unifier.html) or Encoding Master (http://www.elfdata.com/encodingmaster/index.html)

也许Unifier(http://www.melody-soft.com/html/unifier.html)或编码大师(http://www.elfdata.com/encodingmaster/index.html)

#2


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/

听起来你真正的问题是为imagemagick重新排序双向文本。 Unicode双向算法的工作。请参阅http://unicode.org/reports/tr9/该报告列出了两个参考实现。或者看看这个:http://fribidi.org/