TransWikia.com

Install many font on Android device

Android Enthusiasts Asked by Kotolegokot on December 8, 2021

I want to read and write Thai and Tibetan languages and also see real symbols for many other fonts instead of squares.

As you can see, replacing system fonts is not a good method, because in this case we need a font consisting of all the aforecited fonts.

iFont and similar programs also just replace system fonts, but I need to add new ones.

My Android version is 4.4.2.

One Answer

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:

  1. 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.
  2. Enable USB debugging (so you can use adb on your computer to fix your Android device if something goes wrong).
  3. 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.
  4. Copy your custom fonts to /system/fonts.
  5. 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.
  6. 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.

Answered by Mark Haferkamp on December 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP