Skip to main content

LWUIT Arabic Problems

35 replies [Last post]
no_limits
Offline
Joined: 2010-01-12

Good day to all of you :)
I'm trying to make a LWUIT application that support arabic language.

I used the LWUIT designer to create bitmap font "Tahoma" that support arabic.

when i run the application i can see the font is loaded successfuly,
but the arabic words characters are separated and reversed.

note that arabic word characters are linked to each other not separated like english.

If any one has some experience with this problem and how to solve it please help me.

thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lina_gsp
Offline
Joined: 2010-03-27

Hi no-limit

I just found your messages about Arabic support in LWUIt.... I have the same problem while using system fonts.... It seems that you have solved the problem so I was wondering i could have the source code? have you shared it anywhere?

no_limits
Offline
Joined: 2010-01-12

Thanks mahdi,
now sony ericsson mobile is fully arabized with LWUIT :)

Ten Billion thanks to mahdi :)
and only one Billion thanks to people shared thoughts about the problem :)
regards.

Rami Khawaly

Hey, it's great news!!
Thanks mahdi. i will check it, i guess it's update at svn ?

have a lovely day all

Rami Khawaly , NearConn CTO .

NearConn - Let your environment be your contact list

mobile: +972-523492271

e-mail: rami@nearconn.com

www.NearConn.com

----- Original Message -----
From: lwuit-users@mobileandembedded.org
To: users@lwuit.dev.java.net
Sent: Friday, January 29, 2010 7:27:04 PM (GMT+0200) Auto-Detected
Subject: Re: LWUIT Arabic Problems

Thanks mahdi,
now sony ericsson mobile is fully arabized with LWUIT :)

Ten Billion thanks to mahdi :)
and only one Billion thanks to people shared thoughts about the problem :)
regards.
[Message sent by forum member 'no_limits' (ahmed_no_limits@hotmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=383709

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

mike_o
Offline
Joined: 2010-03-13

Hi,

How can I get the source for this change from SVN ? I need to test this, on my sony ericsson?

Thanks,
Mike

Message was edited by: mike_o

Mixa

You can read SVN instructions for LWUIT here:
https://lwuit.dev.java.net/source/browse/lwuit/
You can review SVN changes in web interface there as well.

On Sat, Mar 13, 2010 at 3:12 PM, wrote:
> Hi,
>
> How can I get the source for this change from SVN for this change? I need to test this, on my sony ericsson?
>
> Thanks,
> Mike
> [Message sent by forum member 'mike_o' (mike.o.humphreys@gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=391655
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

mike_o
Offline
Joined: 2010-03-13

Thanks Mixa for your response,

Actually what i'm looking for is how to get this change (the code that has been changed) to support arabic.

How can I find this change?

mahdi_hijazi
Offline
Joined: 2010-01-15

Unfortunately no_limits write this fixing but I don't think he contribute it back to the community, so we hope that no_limits sign the SCA and maybe we can see this fixing in lwuit trunk..

mike_o
Offline
Joined: 2010-03-13

Hi no_limits,

How can we get this fix, community is struggling with arabic on sony ericsson mobiles.

It will be great if you can share your great fix.

abuhmead1987
Offline
Joined: 2010-04-21

Hi Mr no_limits
Can You View your source code Please..

mohammad_kaied@yahoo.com

mahdi_hijazi
Offline
Joined: 2010-01-15

We can fix this problem to some point. But I think we need to change the LWUIT Designer, JME will handle the shaping requirement in most devices, ( SE not one of them ). The problem is that the designer produces the letters in their isolated shape, you can let it generate the glyphs instead of that, and let the JME complete the work for you. I know that glyphs need more than the widths and offsets you are using in the bitmap font like (advance,..etc) but there are many Arabic fonts that will work as smoothly as you did in other languages. Thats why I said we can almost fix it.

Do you have the time to fix this issue, and if not how we can help to fix it because it depends on the designer.

no_limits
Offline
Joined: 2010-01-12

thanks mahdi for your reply, i think we can work together to fix this problem.
vprise, could you please guide us
where can i download the source code of LWUIT?

no_limits
Offline
Joined: 2010-01-12

Dears,
i discovered that system font works great for arabic on nokia mobiles.
but for sony ericsson mobiles, the words are shown reversed and letters are not connected to each other.

does anybody has a clue to solve the problem on sony ericsson mobiles ?

Rami Khawaly

HI,
System fonts are working good with Nokia and samsung. with sony erricsson as you said it's reveresed.
the problem is that if you reverse the letters manually it wont solve the problem because the letters will be sparated. i think the solution is in sony-ericsson hands and not related with lwuit or any other framework.
anyway, if you think about something update me, we can discuss it, maybe we can solve it somehow

Rami Khawaly , NearConn CTO .

NearConn - Let your environment be your contact list

mobile: +972-523492271

e-mail: rami@nearconn.com

www.NearConn.com

----- Original Message -----
From: lwuit-users@mobileandembedded.org
To: users@lwuit.dev.java.net
Sent: Wednesday, January 20, 2010 11:14:19 AM (GMT+0200) Auto-Detected
Subject: Re: LWUIT Arabic Problems

Dears,
i discovered that system font works great for arabic on nokia mobiles.
but for sony ericsson mobiles, the words are shown reversed and letters are not connected to each other.

does anybody has a clue to solve the problem on sony ericsson mobiles ?
[Message sent by forum member 'no_limits' (ahmed_no_limits@hotmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=381914

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

vprise
Offline
Joined: 2003-11-07

Rami is correct, this is a known Sony Ericsson bug:
http://developer.sonyericsson.com/community/thread/39119

The newer devices solve this issue so this is only for compatibility purposes. The solution suggested in the thread above can be applied by overriding the drawString method of the LWUIT implementation (yes that sucks).
You can see how to override this method by looking at our LWUIT incubator demo of the pimped chat from JavaOne where we showed a drawString() method that draws emodicons as images (smiles etc.).

no_limits
Offline
Joined: 2010-01-12

thanks for all of you,
actually sony ericsson mobiles have a big share of mobile markets. So i decided to implement the arabic shaping algorithm passing the unicode of the formatted characters,
and it worked like charm (although it was very painful) :) just final touches that requires hours of work and it will be ready.

Dear Viprise,
i'll study the method you suggested "drawString" and come back to you soon.

thanks again.

mnabil
Offline
Joined: 2010-03-10

Salam ,

i'm trying to get arabic working with direct input textfield but the trial failed , i used the to set the RTL flag with true value , but the input doesn't change and i'm testing on Nokia mobiles ( ex. n95 )

any work around for that ?

Regards,

mahdi_hijazi
Offline
Joined: 2010-01-15

please ask your question in a new thread and don't use old threads...

your problem doesn't related to this thread problem.

thanks...

mnabil
Offline
Joined: 2010-03-10

Actually sorry ,

http://forums.java.net/jive/thread.jspa?threadID=76523

This is the new thread

Thanks

no_limits
Offline
Joined: 2010-01-12

finaly i finished the arabic shaping algorithm and now arabic is shown nicely on sony ericsson mobiles.
but i have a problem. whenever i choose T9 to edit text field or text area the mobile shows me the native editing box and then again the arabic words com reversed.

how to handle this problem? or how can i let the user edit in the text field correctly without the need to go to the native T9 edit box ?

mahdi_hijazi
Offline
Joined: 2010-01-15

this shouldn't happen, did you but your fixing algorithm inside the drawString method. If you do it like this, the text of the text field will not change because of your fixing and the native text box will show them correctly. When the native text box get closet it will change the text field data and a paint call will trigger the new drawString method again, which will fix it one more time.

no_limits
Offline
Joined: 2010-01-12

no mahdi, i didn't put inside the drawString, could you please tell me where exactly is that drawString ?

mahdi_hijazi
Offline
Joined: 2010-01-15

If you don't customize the LWUIT default implementation then it will be in GameCanvasImplementation

no_limits
Offline
Joined: 2010-01-12

Actually i found a difficulty in customizing LWUIT default implementation because they are loading Bitmap fonts in a special way...
so i am using system font passing the unicode of correct shapping character.
that way i have to customize the default implementation of javax.microedition.lcdui.Graphics.drawString

what do you think ? if you agree with me, where is the source code of the above function.

thanks mahdi for your support.

mahdi_hijazi
Offline
Joined: 2010-01-15

ok then, as I said above it is on the GameCanvasImplementation

no_limits
Offline
Joined: 2010-01-12

In GameCanvasImplementation they are calling javax.microedition.lcdui.Graphics.drawString in case of using native fonts.

does anybody know where is the source code of the drawString so that i can override it ?

thanks

mahdi_hijazi
Offline
Joined: 2010-01-15

you don't need to override the native drawString method, just send it the correct Unicode characters after you fix them by using your algorithm.

khayyat71
Offline
Joined: 2010-01-28

I just wondering which to use J2ME Polish or LWUIT ?

vprise
Offline
Joined: 2003-11-07

Arabic won't work with bitmap fonts due to shaping requirements in the language.

no_limits
Offline
Joined: 2010-01-12

thanks vprise for your response.
do you mean arabic language will not work at all ? no work around at all ?
i think i may try to use arabic images png format to write all my labels , but this will increase my jad size too much, what you think guys ????
please help

vprise
Offline
Joined: 2003-11-07

Arabic works great for system fonts.
In bitmap fonts you have a problem since every glyph is needed in several states and the glyphs need to touch one another. There is currently no support there and its needed both in LWUIT and in the resource editor/ant task... Not something that we intend to undertake.
As far as I know there is no solution for Arabic bitmap fonts in MIDP. For LWUIT running on top of MIDP 3 we will be able to load truetype fonts and use them for all languages including Arabic.

bakih
Offline
Joined: 2009-09-06

Hi, i got the same problem.
when i change the lang i can see the string ok , but when i call the theme.res i can see the reverse string. this is what i found until now

Rami Khawaly

are you using sonny erricsson?

Rami Khawaly , NearConn CTO .

NearConn - Let your environment be your contact list

mobile: +972-523492271

e-mail: rami@nearconn.com

www.NearConn.com

----- Original Message -----
From: lwuit-users@mobileandembedded.org
To: users@lwuit.dev.java.net
Sent: Wednesday, January 13, 2010 11:29:46 AM (GMT+0200) Auto-Detected
Subject: Re: LWUIT Arabic Problems

Hi, i got the same problem.
when i change the lang i can see the string ok , but when i call the theme.res i can see the reverse string. this is what i found until now
[Message sent by forum member 'bakih' (barakeholtzer@gmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=380571

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

no_limits
Offline
Joined: 2010-01-12

I'm using sun emulator, not yet deployed to any mobile

Rami Khawaly

can you post a piece of code so i can help,
on my application i'm displaying arabic chars easly from resource file. it's working in many devices perfectly.

Rami Khawaly , NearConn CTO .

NearConn - Let your environment be your contact list

mobile: +972-523492271

e-mail: rami@nearconn.com

www.NearConn.com

----- Original Message -----
From: lwuit-users@mobileandembedded.org
To: users@lwuit.dev.java.net
Sent: Wednesday, January 13, 2010 3:26:30 PM (GMT+0200) Auto-Detected
Subject: Re: LWUIT Arabic Problems

I'm using sun emulator, not yet deployed to any mobile
[Message sent by forum member 'no_limits' (ahmed_no_limits@hotmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=380627

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

no_limits
Offline
Joined: 2010-01-12

thanks rami for reply
are you using bitmap font in your resource file?
i'm doing nothing in the code just loading the resource file and putting label on a form
but the label text is comming from L10N in the resource file