I’m using J2ME polish to develop an app on two samsung devices, the app supports arabic language.
On Samsung star wifi, the app works fine, but on a device like samsung GT-S3653 all letters appears dis-assembled
any help will be highly appreciated
Thanks
I’m using J2ME polish to develop an app on two samsung devices, the app
Share
I speake farsi and I had the same problem in about 4 years ago.You have some way to solve this problem:
1-using custom fonts.
2-reshape your text before display it.
A good article in about first,is “MIDP Terminal Emulation, Part 3: Custom Fonts for MIDP“.But for arabic letters I think that is not simple.
In about second way,say you would to replace any character in your text with correct character.This means when you have:
If get str characters they will be look like:
{1576,1607} that is like “ب ه” instead of “به”.So you would to replace incorrect Unicode with correct Unicode codes(in this case correct characters are: {65169, 65258}).You can use “Arabic Reshapers” even reshapers that designed for android!I saw 2 link for this reshapers:1-github 2-Arabic Android(I’m persian developer and so i do not try them).With using a good Arabic reshaper also you may have problem with character arranging from left to right instead of right to left.(some phones draw characters from left to right and other from right to left).I use below class to detect that ordering is true(from right to left) or not:
If DetectOrdering.hasTrueOrdering() returns true,sure that phone draw Arabic characters from right to left and display your String.If returns false it draws from left to right.If phone draws Arabic character from left to right you would to reverse string after reshape it and then you can display it.