Caveat: The exact files and format vary between Android versions. In both Android O and P (at least on LineageOS), the correct file is /etc/fonts.xml
, and it has a warning not to use it. As of writing, I don't have any devices on Q to test with. So consider this answer historical even if it's still useful.
Warning as of Android P's fonts.xml
(see here for possible updates):
WARNING: Parsing of this file by third-party apps is not supported. The
file, and the font files it refers to, will be renamed and/or moved out
from their respective location in the next Android release, and/or the
format or syntax of the file may change significantly. If you parse this
file for information about system fonts, do it at your own risk. Your
application will almost certainly break with the next major Android
release.
Basically, expect breaking changes when updating Android.
Original answer:
Android does support custom fonts, but there's no user interface for it and you need root access. The basic steps are as follows:
- Make backups in case something goes wrong. Do not skip this step! It's very easy to get stuck in a "boot loop" after making the wrong changes with fonts.
- Enable USB debugging (so you can use
adb
on your computer to fix your Android device if something goes wrong).
- Remount the
/system
partition as writable. Some file managers do this for you. Otherwise you'll need to enter mount -o remount,rw /system
in a console on your phone or use adb remount
from a computer via USB debugging mode.
- Copy your custom fonts to
/system/fonts
.
- Edit
/etc/system_fonts.xml
and/or /etc/fallback_fonts.xml
to tell Android where to use the custom fonts. I don't know where to find the font names for system_fonts.xml
, but adding your fonts to fallback_fonts.xml
should "just work" for characters that aren't in the default system fonts.
- Reboot the device and hope everything worked.
If your device gets stuck in a boot loop, then you can probably still use adb to revert or fix the changes. From experience, this consistently happens when directly replacing the system's Roboto-Bold
font with a custom font that doesn't have as many characters. This is the reason for editing the xml files and adding new files instead of just replacing existing files.