如何通过 Ruby 正确打印阿拉伯语?

发布于 2024-12-17 01:47:50 字数 150 浏览 2 评论 0原文

我正在尝试通过 RMagick 生成图像,其中包含已从 Excel 电子表格解析的阿拉伯文本。阿拉伯字母根据其相邻字母改变形状,这种情况似乎仅在 Excel 中发生,仅用于显示目的。这些字母没有以修改后的形式存储,因此打印出来的结果不正确。有谁知道有一个图书馆可以解决这个问题? TIA

I'm trying to generate images through RMagick that contain Arabic text that has been parsed from an excel spreadsheet. Arabic letters change shape depending on their neighbors and this seems to happen in excel for displaying purposes only. The letters are not stored in their modified form, so they print out incorrectly. Does anyone know of a library that addresses this? TIA

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

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

发布评论

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

评论(2

你的背包 2024-12-24 01:47:50

您使用什么版本的 Ruby?另外,ImageMagick 是否应该首先正确渲染阿拉伯文本?如果没有,你可能想使用 Prawn 或其他东西来生成 PDF 文件......

What version of Ruby are you using? Also, is ImageMagick supposed to render Arabic text correctly in the first place? If not, you might want to use Prawn or something to generate a PDF file...

給妳壹絲溫柔 2024-12-24 01:47:50

您需要在 Ruby重塑阿拉伯文本,ImageMagick/RMagick 才能正确呈现它。

Java 已经解决了这个问题(Better-Arabic-Reshaper) 和 Python(arabic_reshaper)。在将 Ruby 文本传递给 ImageMagick 之前执行相同的任务。 linux CLI:如何将阿拉伯文本渲染为位图

You need to reshape Arabic text in Ruby for ImageMagick/RMagick to render it correctly.

This is already solved for Java(Better-Arabic-Reshaper) and Python(arabic_reshaper). Do the same task in Ruby text before passing it to ImageMagick. linux CLI: how to render Arabic text into bitmap

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