Java:如何手动将阿拉伯字符变成其字形形式

发布于 2025-02-09 11:30:10 字数 502 浏览 1 评论 0原文

据我了解,可以在适当的情况下将阿拉伯语(和波斯语)字符从其规范形式(Unicode)变成其字形形式(Unicode)。

(阿拉伯字母可以连接到其最后一个和/或下一个字符,因此通常具有4种不同的字形表格)

我现在试图使用 vaadin 带有可能包含此类字母的标签和一些特定的字母(例如'ک'或'ی'),无论它们在单词中出现如何,都可以保持其基本形式,例如我所期望的是“骗”我得到的是“ ال‍‌ک‌‍”。

我想到的解决方案是,使用基本形式的标志性形式将每个字母手动将每个字母更改为适当的字形形式,并将其用于一系列字形形式,但我相信应该有一种方法可以在Java的库中进行此操作。我已经看到了这个答案它在字体上使用glyphvector做了类似的事情,但对我而言这很复杂。

提前致谢。

From what I understand, it's up to fonts to turn Arabic (and Persian) characters from their canonical forms (Unicode around 600) to their glyph forms (Unicode around FB00) where appropriate.

(Arabic letters can be connected to their last and/or next character so they usually have 4 different glyph forms)

I am now trying to draw charts using Vaadin with labels which may contain such letters and some specific letters (like 'ک' or 'ی') stay in their base form no matter where they appear in the word, like what I expect is "الکتاب" and what I get is "ال‍‌ک‌‍تاب".

The solution I thought of was to manually change every letter into its appropriate glyph form using a HashMap of base forms to an array of glyph forms, but I believe there should be a way to do this in java's libraries. I have seen this answer which does a similar thing using GlyphVector on a font but it's kind of complicated for my case.

Thanks in advance.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文