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

发布于 2024-07-26 01:59:51 字数 334 浏览 10 评论 0原文

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

有谁知道如何做到这一点?

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

谢谢, 尼夫

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不念旧人 2024-08-02 01:59:52

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

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文