'add new font to AOSP build

I want change the default font in my AOSP GSI builds. I have added them in /extrnal like the standard Roboto font. I have added them in /framworks/base/data/data/font.xml

But they are still not in the system.img



Solution 1:[1]

You can use the vendor_overlay system and add the .ttf prebuilt file and copy it to $(TARGET_COPY_OUT_SYSTEM)/fonts/ using PRODUCT_COPY_FILES. You will also need to modify the fonts.xml to include the changes and build the overlay package as well.

Please check these as a reference point from AOSIP Project since the answer is a bit broad:

https://github.com/AOSiP/platform_vendor_overlay/tree/eleven/fonts

https://github.com/AOSiP/platform_vendor_overlay/blob/eleven/fonts.mk

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rajat Gupta