Indian Languages on Andriod

Continuing  with Android R&D, I have now explored how font rendering works on Android.  If I am not wrong, Due to the internal memory limitation, Android don’t support all the languages. Only Latin bases languages are supported officially. Android uses UTF-8 standard for encoding. UTF-8 is the universal, and support all the languages and scripts.

Andriod have its own fonts and stored in /system/fonts directory.  This directory include the following fonts

  • DroidSans.ttf
  • DroidSans-Bold.ttf
  • DroidSansFallback.ttf
  • DroidSansMono.ttf
  • DroidSerif-Bold.ttf
  • DroidSerif-BoldItalic.ttf
  • DroidSerif-Italic.ttf
  • DroidSerif-Regular.ttf

As the names suggest, it support sans and serif font with bold, italic and mono spaced fonts. All these expect DroidSansFallback.ttf support only Latin based. And to support other languages, DroidSansFallback is used. when the non Latin characters are found in a text, its glyphs will not be present in DroidSans.ttf, but andriod will fallback to DroidSansFallback.ttf to fetch the glyph and present it in the UI.

DroidSansFallback is not complete set, and don’t contain any Indian languages. But if we replace DroidSansFallback.ttf with some Indian Font, say Sampige.ttf (Kannada Unicode font) renamed as DroidSansFallback.ttf , It would render Kannada characters and you will be able to read Kannada websites, twitts, Messages, mails etc.

However android doesn’t support conjuncts (how one character can modify the next or previous), Due to which the complex rendering doesn’t work, But still readable.

When it comes to Indian Languages we have many. I have worked an them and came up a Single Font for all languages . You can find this font on xdadevelopers forum. We don’t have to replace all the fonts, just replace DroidSansFallback.ttf font with this font.

Check this blog to know how to replace. we need to root the phone first.

Here are the sample screen shots of my android phone(Xperia x10 mini) with font installed.

Update: Latest Firmware from Sony Ericsson and Samsung  support Devanagari and Bengali Fonts. And the good news is that, It now support conjuncts (how one character can modify the next or previous). And its Perfectly readable.

For other Languages. The above procedure still holds good.

Here are the screen captures..

Enhanced by Zemanta

52 Responses to Indian Languages on Andriod

  1. sandeep says:

    Hai sreedhar, do you have any documents about the complex text rendering functionality in android. If yes, please share with me. That will be very much useful.
    Thanks for the nice post.

    Regards
    Sandeep S.P

  2. Ravi Desiraju says:

    Hi Sridhar,

    I am experimenting with an Android Tablet device that can be around INR 6,000 to the end user in the Indian market. Already have around 200 devices being deployed in a pilot application in Bangladesh. Can you e-mail the Droidsansfallback ttf file to me at *****@***?

    Thanks and best regards

    Ravi

  3. Sajid says:

    Regarding the “update”, you have mentioned that your phone supports devanagri and bengali scripts. My device has a UK firmware, and official fw does not support devanagri or bengali.

    I updated firmware to a custom froyo. (Cyangenmod) The fonts are not rendering properly. This website (http://forum.xda-developers.com/showthread.php?t=826615) suggests that arabic support can be added by replacing these files:

    /system/lib/libskiagl.so
    /system/lib/libwebcore.so
    /system/lib/libskia.so

    could you please copy these files from your device, using ADB shell and upload them some where. I would like to check and replace them in my device.

    • Sridhar says:

      thanks sajjid,

      I have tried that. It didn’t work.
      I will mail you them. Lets see, if you have a chance.

      • Sajid says:

        Hi, sorry for the delayed response. Thanks for the files. I tried to install them via xrecovery into my device, but unfortunately, device would not boot. Did you have any problem like that? I used ADB shell and first deleted the existing file and then copied it into the device. I am using minicm (2.2.1) and your file version is probably 2.1, that might be one reason why it did not work.

      • Sridhar says:

        Yep even i face the same, device won’t boot. I have tried files from 2.2.1 versions also (from Samsung firmware). It dint work either.

        May be we have to decompile and do some changes.

      • Sajid says:

        According to this forum:

        http://forum.androidspin.com/showthread.php/2376-Arabic-Support?s=ae144b7bb9487a44f0c41609594022d4

        the file framework.jar is also required. So it must change the framework all together. 😦

        I wish the XDA Devs could come up with a hack sooner

      • Aditya Pandey says:

        @ Sridhar I have all the file that that sajid have+ framwork.jar file that you wanted..
        The file is of Android 2.1 and I wanna know that will it work with froyo? or cyanogenmod?

  4. Rakshith Raj S says:

    I am using optimus one, here kannada true type font rendering as prescribed by your method. Please help and give a kannada true type font please

  5. Sajid says:

    I have started a topic regarding this in xda-dev. Hopefully, devs will help with the hack.

    http://forum.xda-developers.com/showthread.php?p=14676378#post14676378

  6. Bushan says:

    Hi Shridar,

    I’m on Motorola milestone running Android 2.3.4 CM 7, Could you please help me in rendering kannada font. I have replaced Droidfallback.ttf and now i’m able to see kannada in FB and Gmail app, but conjuction is not working. Is there any common firmware that can support on CM 7 ROM?

    Please help me in fixing this.. i would like to see my mobile menus in kannada…

    Thanks.

    • Sridhar says:

      I haven’t come across any custom ROMS which support conjuncts so far.. And I haven’t able to crack this yet..

  7. savithru says:

    Hi Sridhar

    Thank you very much for your efforts.

    I, Installed AnySoft keyboard, downloaded fonts and did all that is necessory.

    Yet to replace fonts. As I am not so much familiar with Linux/ android plotform, Please let me know how to replace fonts.

    Is it possible without actually rooting my galaxy s2.

  8. Hari says:

    Hi Sridhar, Am running 2.3.3 on SGS I9000, the above screenshot looks good.
    Can you tell me what firmware you are talking about? Mine is XWJVH…

    Thanks in Advance!!

  9. Aditya Pandey says:

    I have framwork.jar file that you have required it is of Android 2.1..
    Please do next thing for us…
    & I wanna know is it work correctly if I replace these files with ROM like 2.2 or Cyanogenmod???
    Please reply..

    • SriAndroid says:

      i have already tried all those.. but no luck yet:-(

      • Aditya Pandey says:

        Why don’t you open a forum in XDA & share link with us..

        Maybe developer can help us..

        and try to contact with developer who inserted Arabic font with correct renderzation…
        I know this problem is solvable..!!

  10. ਕਮਲਜੀਤ ਸਿੰਘ says:

    I have a idea. Sony ericsson phones(x10,arc……) render indian languages like computer. These phones also have hindi interface. If any android developer can find and apply that system files in other android mobile.

    • Aditya Pandey says:

      Good Idea. Waiting for Sridharrn…

      • SriAndroid says:

        No, it doesn’t work like that. Source needs to recomipled for each type of hardware to make it work.

        I have already tried applying different system files, it din’t work.

  11. I wonder how Samsung has included good rendering engine for their stock upgrade from 2.2 to 2.3, Sridhar, cant we crack those upgrade files and get the exact rendering engine?

    • SriAndroid says:

      Its hurfbuzz text rendering engine. We have to re compile from the sources to make it work.

      • Thanks Sridhar.. Please let us know, if you find any solution for this. i’m eagerly waiting for this.

      • If you need any type of help regarding compiling from sources, may be motafoca can help you. He is developer of ROM MadRom 2.4 for galaxy 5. Please contact me if you know what to do and require some developer to do this.

      • Thanks Aditya, i’m not a developer and have least knowledge on linux, If you guide me how to do the compilation i will do. I’m running Cyanogen mod ROM 7 on my Motorola Milestone.

      • Bushan says:

        Shridhar, Can you provide me any link for recompile of source, i’m running Android 2.3.7 Cyanogen Mod ROM 7 on my Motorola Milestone.

  12. Bhavin Dalal says:

    Hi Shridhar,
    Gr8 job. Now I can read Gujarati, Hindi and other languages; bur some of the English characters are replaced by blocks. For eg try SantaBanta Jokes and in that app all fonts /characters are replaced by blocks. What should I do?

  13. aboobacker says:

    great work… but sir in Malayalam i cant read it properly…. cant u use new Malayalam fonts and make it clear

  14. Sahaja says:

    To get proper complex script rendering working on Android – which is required to properly support Indian languages – as well as installing fonts, you need to replace ibskia.so and libwebcore.so with suitably modified versions.

  15. Vinayak says:

    I tried to move the DroidFallback.ttf & DroidHindi.ttf to /system/fonts using RootExplorer but unable to move. Though the folder is mounted as r/w it doesn’t copy the file there & doesn’t flag any error too.. 😦

    • SriAndroid says:

      IS it rooted?

    • Bushan says:

      It happens when /system is running out of free space. You have to delete some unwanted font files, preferred other language one not the one system uses, like Chinese or Japanese. If you hav terminal emulator in your phone, try running #ds or #df (not sure) it gives you free space available in /system. Have a try…

  16. Sudheendra says:

    Hi Shridhar,
    I use Xperia mini pro with Cynagenmod 10 (4.1.2). Kannada is rendering properly on browsers, but not properly rendering on native apps like contact/Messaging app. Please guide me how to update following files to render kannada natevely
    /system/lib/libskiagl.so
    /system/lib/libwebcore.so
    /system/lib/libskia.so

    Thanks,
    Sudheendra

  17. ajay says:

    does it work on xperia tipo dual ? …………pleas emai to ajaykabariya@gmail.com

  18. sudheendra says:

    Hi Shridhar,
    On my xperia mini pro, still kannada conjuncts are not rendering properly though simple letters are rendered beutifuly.

    Regards,
    Sudheendra

  19. Sagar says:

    I am trying to get the kannada font support for Android ICS. I rooted my Xperia Neo L phone which is running Android ICS 4.0.4 and installed Kannada font (Lohit-Kannada.ttf). I have also included the Lohit-Kannada font as family-set in fallback_fonts.xml in the framework. After that, I am able to see the kannada fonts render in browser but the complex script is not supported. Glyphs are not rendered in proper way, though it is just readable. Other indic languages like Tamil, Hindi, Bengali etc renders perfectly but my language is not rendering properly. Someone suggested me to go thru this blog. http://androidandsandu.blogspot.in/2011/12/how-to-add-indian-languages-to-android.html But i’m not able to find out where to make those file changes. I mean where is that lohit-fonts directory, where is the android.mk file? I’m not able to find those folders or those files in my phone. Any help please?

  20. Avik Papon says:

    I have Karbonn A7 … i changed font many times bt bangla words dint render well … so one said its because of libskia.so related probs . no one could help me …. it would be kind if u inform me

  21. Sharath N says:

    Thank yo so much sridhar.I have rooted my sony xperia tippo(ST21i) successful using a kingroot app.I was searching for installing Kannada fonts on my mobile then i saw this website, then i downloaded the zip file mentioned above and copied into font folder then i rebooted. So magic really happend my mobile supported Kannada ,once agian thanks for Sridhar. I suggest ES file manger to copy the files into font folder.

Leave a comment