某些型号上 LWUIT 中的阿拉伯语单词问题

发布于 2024-12-06 23:13:19 字数 658 浏览 1 评论 0原文

我使用 LWUIT 创建了一个 gui,它使用阿拉伯语单词(因此它是从右到左)

它在某些型号上运行良好(例如索尼爱立信 T700 或 Elm)。但在某些其他型号(例如索尼爱立信w800)上,文字显示不正确:字母被分开并从左到右一一显示。

我完全不知道原因。

我找到了这个帖子:
LWUIT:显示阿拉伯语单词时出现问题?

这篇文章由 LWUIT 开发者之一 Shai Almog 回答。

所以我在代码中添加了以下行:

list.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM));

但这并不能解决问题。

1- Shai 回答说应该使用系统字体。我的代码设置系统字体是否正确?

2-还有其他线索吗?

我已经使用 LWUIT 1.5 和 1.4 测试了我的应用程序,对于这个问题,两者都是相同的。

有人能帮我解决这个问题吗?

先感谢您

I've created a gui using LWUIT which uses Arabic words (and so it is right to left)

It works fine on some models (Sony Ericsson T700 or Elm for example). But on some other models (e.g. Sony Ericsson w800) words are not displayed correctly: letters are separated and displayed one by one from left to right.

I have absolutely no clues about the reason.

I found this thread:
LWUIT : issue in showing arabic words ?

This post is answered by Shai Almog who is one of LWUIT developers.

So I added below line to my code:

list.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM));

But it doesn't solve the problem.

1- Shai has answered that system fonts should be used. Is my code correct in order to set system font?

2- any other clues?

I have tested my application with both LWUIT 1.5 and 1.4 and both are the same regarding this problem.

Can anybody help me out of this?

Thank you in advance

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

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

发布评论

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

评论(2

生死何惧 2024-12-13 23:13:19

据我所知,一些索尼爱立信手机在显示阿拉伯字体时出现问题。它将在此论坛中进行讨论。

AFAIK some Sony Ericsson mobiles having problem while showing Arabic font. It will be discussed in this forum.

时光沙漏 2024-12-13 23:13:19

好的,我搜索了问题,现在我有话要说:
当我们在旧的索尼爱立信型号上使用 LWUIT 来显示阿拉伯文本时,似乎存在问题。该问题不会出现在较新的 SE 型号上,并且当您使用标准 jme 或 j2me Polish 时不会出现此问题。 (正如您在我原来的帖子中看到的,w800 有问题,但 T700 没有。所以在 2005 年到 2008 年之间问题得到了解决)。
系统字体有这个问题,并且您不能使用位图字体,因为 LWUIT 不支持阿拉伯单词的位图字体。 (参见:LWUIT:显示阿拉伯语单词时出现问题?

如何解决
网上的朋友指导我解决了这个问题:

要解决第一个问题,您应该自己重新调整字符串的形状,我
尝试搜索一些类似的代码,这可能对你有帮助
http:// code.google.com/p/glyph-util/source/browse/trunk/src/com/ahmadiv/dari/DariGlyphUtils.java

您应该根据每个字符将其映射到正确的字形
单词中的位置以及字符周围的字符。

这可能对您有帮助:http://unicode.org/charts/PDF/UFE70。 pdf

然后,镜像单词以最终解决问题。

最后,添加对LWUIT的drawString()方法的修复。
只是,最后一点……这不值得头痛。那些手机
有这个问题的是非常旧的手机。我想你可以跳过
支持他们。我们已经停止支持他们。

我接受了他最后的建议,所以我最终没有解决问题,我只是把它留下了:-)

OK, I searched for the problem and now I got something to say:
It seems there's a problem when we use LWUIT on old SonyEricsson models to show Arabic texts. The problem doesn't show up on newer SE models and you won't have this problem when you use standard jme or j2me polish. (As you see in my original post, w800 has the problem but T700 doesn't. so somewhere between 2005 and 2008 the problem is solved).
System fonts have this problem and you can't use bitmap fonts since LWUIT doesn't support bitmap fonts for Arabic words. (see this: LWUIT : issue in showing arabic words ? )

How to solve it :
A friend on the net guided me to this solution:

To fix the first problem you should reshape the string yourself, I
tried to search for some similar code, this might help you
http://code.google.com/p/glyph-util/source/browse/trunk/src/com/ahmadiv/dari/DariGlyphUtils.java

You should map each character to the correct glyph according to its
location in the word, and the characters surrounding the characters.

This might help you: http://unicode.org/charts/PDF/UFE70.pdf

Then, mirror the words to finally fix the problem.

Finally, add the fix to drawString() method of LWUIT.
Just, final note..this don't worth the headache. The handsets that
have this problem are very old handsets. I think you could skip
supporting them. We already stop supporting them.

I accepted his final advice, so I didn't solved the problem at last, I simply left it :-)

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