开发者

Arabic words problem in LWUIT on some models

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开发者_C百科 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


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜