This tutorial will explain how one can replace the default Android font used by icons and system menus on CyanogenMod with a truetype (.ttf file) font of your choosing without the purchase of specialised third-party software to modify fonts. The only prerequisite is that you must use a terminal emulator to run commands on your tablet or mobile.
The terminal application I use on my tablet is the free and appropriately named Android Terminal Emulator app, available for download from here if you have not already installed an emulator of your own choosing. I will also be presenting the information in this tutorial from the perspective of a Windows user, although the same concepts can easily applied by users of Mac OS or Linux.
First things first – connect your tablet or mobile running CyanogenMod to your computer via the USB cable. The USB connected screen on your tablet will appear shortly thereafter prompting you to tap or select a button to connect to your PC:
Select your favourite font, and copy its .ttf file located in the C:\windows\font folder. This is most easily accomplished by choosing View and Details from the menu in Windows Explorer. For Mac users, Apple has made this guide to aid in finding the location of fonts on OS X.
The next step requires placing the copy of this file on our Android CyanogenMod based tablet or mobile. Most likely Windows will have assigned two drives representing your tablet, do not paste the font file on a drive if you see temporary files, or recovery folders as this screenshot illustrates:
Instead, choose the drive that is uncluttered and will be much cleaner in appearance. Keep in mind the assigned letter of the “good” drive usually falls after the “bad” one due to drives generally being assigned in alphabetical order -and- because we need the drive designated by Windows as the “USB storage” drive, so that we may paste our copied font file:
Disconnect your tablet or mobile from your desktop, and open the Terminal Emulator application mentioned earlier.
Type the following command at the $ prompt.
$ ls /sdcard/*.ttf
The system should return /sdcard/yourfontname.ttf like so:
If you do not see any file found by the system, then the font file was placed on the wrong drive and needs corrected.
Once the file is verified to exist in the correct location, superuser needs enabled, so that the system folder can be remounted in read-write mode. These steps “clear the way” for the font file to be placed in the proper spot and “visible” for use by Android.
The font that Android uses for icons and system menus are the DroidSans and DroidSans-Bold fonts. We can now make a backup of these fonts, before proceeding further. I chose to use the cd command to change directories directly into the fonts folder, then copy the files to the SD card with these commands:
# cd /system/fonts
# cp DroidSans*.ttf /sdcard
Because the stock font files have been backed up, we will remove the stock version DroidSans font files, creating new versions in their place with renamed copies of the custom font chosen earlier.
Use the next four commands, replace yourfontname.ttf with the name of the file returned by the ls command earlier. Please ensure to faithfully duplicate upper and lower case characters, otherwise the commands will not work properly as the Android linux shell is case-sensitive.
# rm -f DroidSans-Bold.ttf
# rm -f DroidSans.ttf
# cp /sdcard/yourfontname.ttf /system/fonts/DroidSans-Bold.ttf
# cp /sdcard/yourfontname.ttf /system/fonts/DroidSans.ttf
Last but not least, enjoy your new custom system font!