Monday, August 30, 2010

[How to] Change fonts on Nexus One

Few days back, I had rooted my Nexus One using the article I had posted about rooting the Nexus One. One of the main reasons behind that move was the inability of Android to render the text in my mother tongue (Tamil). The plain vanilla Android 2.2 does support only a limited set of fonts and it has no support for Unicode yet. DroidSans is the default font used on Android devices. Fonts are placed inside /system/fonts folder of the Android system. After rooting my device, I tried installing few fonts which support Unicode char-set and my Nexus One is able to render Tamil characters now. However, some special glyphs of the Tamil language are not getting rendered properly. This is something to do with the position of the characters. Anyways, now I can read my favorite Tamil blogs on my dearest Nexus One.

Tamil text being transliterated Sending out a Tamil tweet from Nexus One 

Nexus One displaying Tamil characters!!

Here are the steps to be followed to change fonts:

  • First requirement here is that your device must be rooted.
  • Find out the font which supports Unicode char set. I have used “Arial Unicode MS” for rendering the Tamil characters.
  • Download and install the latest Android SDK from here. This comes up with all the tools needed for development and testing of your application. Make sure the driver ‘ADB interface’ is installed on your machine. In most of the cases, the driver will be installed directly once you plug-in the device.
  • Connect your Android device to your PC on debug mode. Enable USB debugging on your phone. Settings > Applications > Development > USB debugging.
  • On your laptop, open a command prompt and enter “adb shell”.
  • By default, /system partition is mounted as read-only. Need to re-mount the same in read-write mode. Follow the instructions here to do this.
  • Take a backup of the DroidSans font in super user mode. “adb shell”  > su > mv /system/fonts/DroidSans.ttf /system/fonts/DroidSansOriginal.ttf
  • After that, you have to push the Unicode font you have selected by executing the command “adb push <path to your font file> /system/fonts/DroidSans.ttf” So, we are just replacing the DroidSans font with the new one. The font you are choosing should support the characters originally supported by DroidSans. Otherwise, this is what will happen.

-- Varun

17 comments:

  1. I am surprised to hear that Android doesnt support unicode without root-ing. The glyph problem exists in chrome browser as well.

    http://code.google.com/p/chromium/issues/detail?id=21320

    ReplyDelete
  2. Unicode support is one thing which I have been badly missing. Thought they will announce the support for it during the recent press meet for the Voice actions.

    -- Varun

    ReplyDelete
  3. என்னுடைய போன், HTC EVO 4G, Android 2.2, Rooted.

    நீங்க சொன்ன முறையை, கொஞ்சம் தலையை சொறிஞ்சிகிட்டே, ஒரு 1 மணி நேரத்தில் செஞ்சி முடிக்கும்போது, எக்ஸலண்ட்.

    நீங்க சொன்னதுபோல வார்த்தைகள் தமிழில் தெரியுது. அதற்கு ரொம்ப நன்றி. :) :)

    ஆனால், டீஃபால்ட் ப்ரவுஸரில் இன்னும், சில வெப்சைட்கள், முழுக்க கட்டம் கட்டமாகவும் (www.karundhel.com), சிலது சுமாராகவும் (www.cablesankar.blogspot.com) தெரியுது.

    இதுக்கு அந்த வெப்ஸைட்களின் என்கோடிங்கள் பிரச்சனையா?

    Opera mini தான் இப்போதைக்கு வழி போலத் தெரியுது.

    இருந்தாலும் உங்க வழிமுறைகளுக்கு மிக்க நன்றிங்க. :)

    ReplyDelete
  4. @Bala Did you try restarting the device after copying the font?

    ReplyDelete
  5. Yes I did. Well it didn't hotmail fonts until I restart.

    ReplyDelete
  6. மன்னிக்கனும். போனில் இருந்து டைப் பண்ணினேன். அது ‘show the'-ங்கற வார்த்தையை 'hotmail'-ன்னு ஆட்டோமேட்டிக்கா சேஞ்ச் பண்ணியிருக்கு.

    நான் போன கமெண்ட்டில் குறிப்பிட்ட அந்த இரண்டு வெப்சைட்களையும், உங்க Nexus One-ல் பார்த்தீங்களா? உங்களுக்கு அது சரியாக தெரியுதா?

    ReplyDelete
  7. @Bala: Both the sites are using the Seriff fonts. You should have to replace the DroidSeriff fonts as well.

    -- Varun

    ReplyDelete
  8. gotcha! :)

    ரொம்ப நன்றி வருண். :)

    ReplyDelete
  9. தற்போது ஆண்ட்ராய்ட் கற்றுக் கொண்டிருக்கிறேன். எமுலேட்டரில் தமிழ் பக்கங்களைக் காண முடியவில்லை. நீங்கள் கூறியிருக்கும் வழிமுறைகளை செய்து பார்க்க போகிறேன். நன்றி.

    ReplyDelete
  10. Dear Varun,

    I am in dilemma to buy either iPhone 4 or samsung captivate(android). My main purpose is to read Tamil websites. Once I root captivate , will I be able to read Tamil fonts easily? Just wanted to see how the Tamil fonts will look like after rooting. Could you please send a screen shot of any tamil websites from android phone? I have to decide before end of the day today. Please help me. My email I'd is [email protected]

    ReplyDelete
  11. Android does not have much support for Indic languages. If that is your primary use case, go for iPhone 4. Check the screen shot attached on this page.

    ReplyDelete
  12. hi varun, i tried everything but the last step screwed me. where could i find the arial unicode font? really helpful if you direct me

    ReplyDelete
  13. @SaravanaKumar: Press Win + R. Type 'fonts' in the 'Run' dialog. This will open the fonts folder. Use the font 'Arial Unicode MS (truetype)

    ReplyDelete
  14. Which font should we use for DroidSeriff fonts? I' also not able to see certain websites like dinamalar properly. Thank you

    ReplyDelete
  15. You can use any font which support Unicode characters.

    ReplyDelete
  16. Did you do anything beside copying font? I tried installing as DroidSansFallback but still glyphs are broken.

    ReplyDelete