maandag 10 januari 2011

Persian/arabic reshaper for (Android) Java

In Android it is not possible to display Farsi, Dari, persian or Arabic letters, well it is possible but they are not shaped correctly.
We have designed some helper classes that you can use to reshape persian and arabic letter and connect them correctly.

Ofcourse it is very amateurish and not good designed by google.com because persian and arabic languages are supported by many OS's, including iOS and WMP.

The DariGlyphUtils class has one public static method, which is responsible for reshaping Dari, Persian and Arabic letters.
Just simply, add the class to your project and


String somePersianWords = "...";
String reshapedWords = DariGlyphUtils.reshapeText(somePersianWords);
Get the code from

For Android developers:
Make sure that you are using a TrueType font, for example Arial.

4 opmerkingen:

  1. hello.....
    plz help me to reshape persian fonts on Archos Tablet!

    this is my yahoo ID : m_1373
    add me plz...
    tnx

    BeantwoordenVerwijderen
  2. It depends on device, if you embed your truetype font in your app then you will be able to reshape them correctly

    BeantwoordenVerwijderen
  3. Hello,

    I've installed your app called 'Hadis Eshgh'. That was awesome.

    I've just an important suggestion, Great books like Masnavi, Hafiz, ... deserve a great script. A good script vitalize the content. I highly recommend you using 'IranNastaliq' Font in your app :
    http://www.scict.ir/portal/Home/Default.aspx?CategoryID=c7a865b2-7b95-4169-ad94-f9de320528d7

    BeantwoordenVerwijderen
  4. Hello, this is the best Persian class in the World, thanks a lot! :)

    BeantwoordenVerwijderen