Tuesday, January 15, 2013

Create your own Malayalam flip font for Android

Certain Samsung devices allow you to change system font by installing flip font (font apk). Your device should have Settings -> Display -> Font Style option for this to work. Not all Samsung devices have this option.

Creating a flip font is an easy task. You can find many posts about this on the net (mainly in xda forums) but creating a Malayalam font apk is little tricky. Steps mentioned in other places will not work for Malayalam font as the process will not copy GSUB tables correctly to the digitally signed font.

Tools needed:

  1. Windows machine
  2. Fontforge (http://sourceforge.net/projects/fontforge/files/latest/download?source=files)
  3. Apk Manager v4.9 (http://goo.gl/GKBHM)
  4. A working flip font (http://goo.gl/cfTJU)
  5. A blank digitally signed font BlankSigned.ttf (http://goo.gl/Gefuf)
  6. A font that you want to convert to flip font
Steps:

Create signed font
  1. Install Fontforge
  2. Download BlankSigned.ttf to local disk
  3. Run Fontforge
  4. Open Font -> Browse and select your font (ex: MyFont.ttf)
  5. File -> Open -> Browse and select BlankSigned.ttf
  6. Element -> Merge Fonts ... (Make sure you select this option from BlankSigned.ttf font window)
  7. Click OK. This will merge your font with BlankSigned.ttf font.
  8. File -> Generate Fonts ... -> Select TrueType for font type -> Enter a name for the font (ex: MyFont.ttf) -> Save. Try to use a font name without special chars or numbers to make things easier.
  9. If you get Errors detected window, just click Save
  10. Now you have a digitally signed font that you can include it in font apk
Create font apk
  1. Download Apk Manager v4.9 and unzip to local disk
  2. Copy working flip font (Kaumudi.apk) to apk_manager_4.9\place-apk-here-for-modding folder
  3. Open cmd window and cd to apk_manager_4.9
  4. Run "Script.bat"
  5. Press any key to continue on adb warning
  6. Type 22 and hit enter
  7. Type 1 to select Kaumudi.apk. If you see multiple apks, type the number corresponding to Kaumudi.apk
  8. Type 9 and hit enter to decompile apk. Don't close cmd window. We need it for later.
  9. Now you will see apk_manager_4.9\projects\Kaumudi.apk folder in file system
  10. Replace Kaumudi.ttf in apk_manager_4.9\projects\Kaumudi.apk\assets\fonts with your signed font (ex: MyFont.ttf). I'm going to use MyFont as the name of new font for rest of the steps. Change it to your actual font name. Also rest of the steps are for the files/folders in apk_manager_4.9\projects\Kaumudi.apk folder
  11. Rename assets/xml/Kaumudi.xml file to assets/xml/MyFont.xml
  12. Rename smali/com/monotype/android/font/Kaumudi folder to smali/com/monotype/android/font/MyFont
  13. Open each xml, yml, smali files in apk_manager_4.9\projects\Kaumudi.apk folder and sub folders in a text editor and replace Kaumudi with MyFont
  14. Switch back to cmd window
  15. Type 11 and hit enter to compile apk
  16. Type n for system apk and hit enter
  17. Type 12 and hit enter to sign apk
  18. Now you will see signedKaumudi.apk in apk_manager_4.9\place-apk-here-for-modding folder. Rename it to MyFont.apk. That's your flip font.
  19. If you have followed instructions correctly, you now have a flip font that you can install on your device.
Let me know if you find any errors in my instructions.

8 comments:

Unknown said...

When i install the font all text seems VERY small, how can i fix that?

Unknown said...

You can use TypeLight free app for windows to increase font size. The lesser the value the bigger the font size will be. If it based on 1000 you can enter the value of 900 or even lesser.

AuralArch said...

Thank you so much! This is fantastic. Very concise & well-written. I appreciate very much your time & effort to share this knowledge with us.
It seems clear that this procedure will work for any unicode TT based fonts that utilize non-western scripts.
The last time I researched this topic I wasn't able to find all the necessary information in a complete form that I could understand to apply to my project.
The resulting fonts never worked as intended for the target language.
I'm looking forward to finally being able to realize my project.
You are very gracious- thank you!

10000books said...

It's perfect.
Thank you very much for your effort.

Now I have to modify my font for my phone.

Ali said...

I can't decompile the apk, error showing, java couldn't find the path C:/apk_manager.4.9.zip/place apk here for modding/unsignedkaumudi.apk

is there any solution for this?

Divyesh said...

Hello,

I cant download apk manager from given link...

pslvseo a5 said...

Dafont.com is a site where you can download a ton of free fonts. You can search for a specific typeface, or search by the type of lettering you want, whether it’s serif or sans serif, hand lettered or grunge style. You can also put in your own phrase to see how it looks in a particular font. A lot of these fonts are very decorative and many are handdrawn, so it’s not always the best place to search for body text fonts. Each selection also tells you whether your download is free for personal or commercial use. The download is easy – you get a zip file with the font file inside. Unzip, install, and you’re ready to go.

pslvseo a5 said...

Dafont.com is a site where you can download a ton of free fonts. You can search for a specific typeface, or search by the type of lettering you want, whether it’s serif or sans serif, hand lettered or grunge style. You can also put in your own phrase to see how it looks in a particular font. A lot of these fonts are very decorative and many are handdrawn, so it’s not always the best place to search for body text fonts. Each selection also tells you whether your download is free for personal or commercial use. The download is easy – you get a zip file with the font file inside. Unzip, install, and you’re ready to go.