Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Last Harka is showing before the first character of the line in Arabic Reshaper on Android

I am using this Amazing Arabic Reshaper for my app on Android, Every thing works fine, but there is a little problem with it that it always shows last Harka (Harki) before the first character of the line in Android, I have also tried gravity right etc

It works fine for Android version greater 2.3.3, as this is a right to left language I dont understand why its not working fine on Android versions less then 2.3.3 you can see the image below for better understanding.enter image description here

I also tried that I moved the last Harka to the first character of the line, it works fine for first line only BUT on the after that same issue comes. Kindly help me regarding this issue.

like image 306
Muaz Usmani Avatar asked Nov 15 '12 22:11

Muaz Usmani


1 Answers

It seems that the reason of this is the Bidi rules; when you mix letters and symbols the last symbol does not follow the sentence direction unless it is between two letters. That's why you are getting it only with the last Haraka.

For Android versions that support bidi natively, you should not use the Arabic reshaper library. Only use it for Android versions that does not connect Arabic letters properly. You can add an option in your application where the user decides weather or not Arabic letters are displayed properly.

Alternatively, you can have in your application an exhaustive list of Android version and weather or not it supports Bidi natively, so you automatically decide when to use the Arabic reshaper.

like image 136
iTech Avatar answered Oct 04 '22 21:10

iTech