1

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

Community
  • 1
  • 1
mohsenof
  • 109
  • 2
  • 11

2 Answers2

1

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

bharath
  • 14,283
  • 16
  • 57
  • 95
  • Thank you for the link. But I have applications that work well even on those older SE mobiles. I checked their jar files. Some of them have .bmf files which seems to be related to fonts. Can you guess what are they doing? – mohsenof Sep 27 '11 at 13:10
  • that is bitmap file's. are you using any bitmap? – bharath Sep 27 '11 at 13:12
  • I've not created those applications, I just have a copy of them. I know nothing about how they work. Do you know how they use these files? – mohsenof Sep 27 '11 at 13:24
  • You are using system font for list. So there is no issues. May be problem is on sony ericsson. – bharath Sep 27 '11 at 13:39
  • may you give me some hints how I can create and use bitmap fonts using these files? – mohsenof Sep 27 '11 at 14:24
0

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

Community
  • 1
  • 1
mohsenof
  • 109
  • 2
  • 11
  • Polish suffers from the exact same problem since this is a bug in the SE drawString() method implementation. LCDUI components don't have this problem since Sony Ericsson fixed the problem incorrectly (only in the high level API and not in the low level API). As you say its a bug in older devices only. – Shai Almog Sep 29 '11 at 09:20