Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I automatically "reshape" complex scripts?

Problem:

I'm trying to display a small amount of text using complex scripts such as Arabic and Bengali on mobile devices (specifically Android, BlackBerry phones, and BlackBerry PlayBook). (The app is Allergy Traveler) These devices both fail to correctly display the text, but for different reasons.

On Android and PlayBook, I can supply a font in which case the characters display, but the characters are not connected correctly. Each character displays without considering the context.

On BlackBerry, the device doesn't have appropriate fonts. I can supply a font, but the font file far exceeds the maximum font size (70kB).

Proposed Solution:

I think the process of correctly using context to display a word is called reshaping. Presumably, this takes the text and returns an alternative set of characters to display. My proposed solution is to do this reshaping in advance. On Android, this would ensure the text correctly uses the context, and on BlackBerry, this would allow me to remove unused characters, and reduce the font size.

Question:

Are there any APIs to do this "reshaping" or any other suggestions? I'm willing to use any technology on Windows or Linux (eg a Win32 API, Perl, Python, Java, ...)

Thanks for all the suggestions.

like image 543
Garret Avatar asked Feb 04 '26 21:02

Garret


1 Answers

For reshaping arabic on android it is possible to so using Amr Gawish's arabic reshaper framework, check out http://bar.amr-gawish.com/. However, you should note that although it reshapes and joins normal arabic letters and text correctly, it isn't able to join arabic letters if the text contains diacritics.

I have noticed an app in the android marketplace that joins/reshapes arabic text with diacritics but I'm not sure what they've used to do so, it may perhaps be their own internal framework. I'm also interested in finding reshaping APIs, in particular ones that can deal with arabic diacritics too.

Hope the above link help! Let us know if you find anything better.

edit: the following can do diacritics too - https://github.com/AhmedEssam/Better-Arabic-Reshaper

like image 187
graftan Avatar answered Feb 06 '26 10:02

graftan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!