How to change system-wide fonts in LineageOS - LineageOS Questions & Answers

I am making a custom ROM based off LineageOS. And I am thinking of changing the fonts system wide (settings, lock screen, quick settings, etc).
My question is:
1. Where is the folder that contains all the fonts used by the system?
2. Which script do I edit in order to change the fonts used by the system?
I already tried frameworks/base/data/fonts/Android.mk and frameworks/base/data/fonts/fonts.mk but to no avail
Thanks!

One year late but maby...
Maby you find what you need in /system/fonts. The default is Roboto-Regular.ttf.

so...
what is the answer to the question?

I guess copy to /system/fonts and then edit /system/etc/fonts.xml until eyes fall out?..

Related

System fonts

Is there any way to change the system fonts?
Sent from my Galaxy Nexus using Tapatalk
Replace DroiSans.ttf (and DroidSanBold.ttf) in /system/fonts/ with your preferred font.
You'll need to be rooted of course.
heads up, some fonts are not changed, and some ttfs cause weird stuff, like in app manager the name of the app layered above, cutting of some the size on disk taken by that app.
i would recomend using a font not too big.
app font changer also works, but ofc, you'll need root.
regards
Japanese system font
Problem: The default Japanese font on Android phones sold outside of Japan is actually a similar, but slightly different, Chinese font. Therefore, I would like to install a genuine Japanese system-level font on a GSM Galaxy Nexus that I am hoping to have in my possession early next week. I assume I can copy a suitable Japanese font (MTLmr3m.ttf) into the /system/fonts/ directory. However, I do not know whether it will be recognized as is, or if I need to rename it and replace an existing font (perhaps DroidSansFallback.ttf). Thanks in advance.
Thought I should answer my own question on the chance that it might help someone else. Copying the Japanese font (MTLmr3m.ttf) into the /system/fonts/ directory on my Nexus One worked as is. I didn't have to rename it. However, copying the Japanese font (MTLmr3m.ttf) into the /system/fonts/ directory on my Galaxy Nexus didn't work. I had to rename it to DroidSansFallback.ttf and replace the original to get it working. I am a little surprised that Gingerbread and ICS are different in this respect, but all is well now.
I thought I'd give Rom Toolbox a mention. It does all the hard work for you.
gibosi said:
Thought I should answer my own question on the chance that it might help someone else. Copying the Japanese font (MTLmr3m.ttf) into the /system/fonts/ directory on my Nexus One worked as is. I didn't have to rename it. However, copying the Japanese font (MTLmr3m.ttf) into the /system/fonts/ directory on my Galaxy Nexus didn't work. I had to rename it to DroidSansFallback.ttf and replace the original to get it working. I am a little surprised that Gingerbread and ICS are different in this respect, but all is well now.
Click to expand...
Click to collapse
I've found a post on a japanese blog explaining how to add a new font to the system (on a Galaxy Nexus).
The author adds the DroidSansJapanese.ttf font by copying it to the /system/fonts folder (and check permissions). Then he edits the file /system/etc/fallback_fonts.xml adding
Code:
<family>
<fileset>
<file>DroidSansJapanese.ttf</file>
</fileset>
</family>
After reboot the screen properly displays all japanese characters.

[Q] Patching fonts using PFS file?

As we know, font files are included in the CSC file, in CSCrcs/SystemCSC/Font. I wonder, can fonts be changed or replaced in a running system, without loosing data?
I already tried this using PFS files, putting fonts inside there in CSCrcs/SystemCSC/Font and inside SystemCSC/Font - does not work. I guess we can't replace CSC data with a PFS file, right?
Background (if you want to know why I want to do this): I've made a set of slim fonts for my own CFW. These are only 10% in size of the original ones, but don't include asian fonts. Now, there are of course some users who want the asian symbols back, and I don't want to have 100s of different CSC files.

[Q] Any way to quickly replace the stock system font files?

Hello! I am an avid OCD font freak and must have all my phones use Roboto Condensed throughout the system! Installing the font through the theme market does not replace ALL the fonts so what I usually do is pull the font folder from the ROM I am using and replace each font individually with the appropriate Roboto Condensed file (reg, italic, bold, etc.). Is there a way to replace a batch of font files (i.e. all the regulars) with a single file (i.e. Roboto Condensed-Regular) while retaining the original file names, and then go through and do the same with the bolds, italics, etc.? I have looked around with no luck, so if such a thing exists it would make my flashable font zip creation a much quicker task! I have access to Windows as well as Linux so anything will work. Thanks in advance for any information and I will forever be in your debt to whoever can point me in the right direction! Yarrrrrrrr!! :silly:

Changing font - failed to change

Hi all,
I know it is an old problem but still not yet fixed for several Galaxy S series and Note series phone especially since Lollipop version.
I need to use a custom flipfont.
I know I can use Aptoid to install some of the paid fonts, but those paid fonts are not the font I want to use.
This is how i tried.
1st way
I use APK tool to decompiled, compiled, signed the apk without modifying anything.
I can install the font, But when i set the font in Settings->Display->Font type
I got "the font is not supported error"
If i install the original apk, then it works without any problem.
2nd way
Use APK tool to decompile the apk
open the existing font and and replaced with the glyphs from my font after deleting and "paste with special" by Adding mappings option. By doing that I won't lose the font which was digitally signed by Samsung or so as they say.
recompiled and signed.
still the same problem.
Where did I do wrong?
What I can conclude is once i decompile the apk, samsung knew it somehow or something happened to the somewhere.
Can anyone enlighten me?
Thanks in advance.
Cheers
if rooted, use ifont app

How to manually install custom font

Hello all...
I have a rooted M9 with ViperOne installed, recently upgraded from v4.3.0 to v6.2.0. I'm seeing a few minor but annoying bugs. One of which is the inability to download fonts from HTC. Whenever I go into the edit theme section in the personalization settings, I get a network error message. There are only four fonts available. One under HTC fonts and three under "other fonts".
With ViperOne 4.3.0 installed, I was able to set a custom font that worked perfectly. It's been at least six years so I can't remember how I came by this method, but on 4.3.0, I was able to paste a "com.htc.theme" folder in /data/media/0/Android/data/com.htc.launcher/files/LocalTheme/. I only know this because I have a copy of this folder and a text file with instructions on what to do with it saved on my SD card. I tried doing that on this version of ViperOne and even after a reboot, nothing changes and the font is not a visible option in theme editing.
I've been searching for a solution for the last few days and nothing that I have found works. I've read in more than one post that there is a way to flash fonts from recovery but any links to files or instructions have been broken or they don't match my file structure.
I'd be grateful for any tips or suggestions. Thank you.
If you have root access, You can easy get into /root/system/fonts and can change any font with ROBOTO ones. Remember to change that font name to Roboto-Regular and all other Roboto font family. This should work.
Hope it helps!
ai.Sanaul said:
If you have root access, You can easy get into /root/system/fonts and can change any font with ROBOTO ones. Remember to change that font name to Roboto-Regular and all other Roboto font family. This should work.
Hope it helps!
Click to expand...
Click to collapse
Greetings ai.Sanaul...
Yeah, that works but it's very cumbersome. There's at least eight variants of Roboto that I would need find equivalent .ttf versions of to duplicate. Finding a full font family like that without paying $100+ for it is very difficult. On ViperOne 4.3.0, the theme folder that I used only had one .ttf file and somehow, the system adapted it to the required style (ie: bold, italic, etc.) seamlessly across the board including third-party apps.
Thank you very much for your suggestion. I may end up doing that in the end but I was hoping for a method that's a little more plug-and-play.
{Mod edit: Quoted post has been deleted. Oswald Boelcke}
Unfortunately, this method does nothing. The fonts that show up in personalization must be must be kept in another directory because adding font files to system/fonts doesn't add them to the fonts menu.
There are 147 .ttf files in system/fonts, yet only three options are available in theme editing. See attached.
Ok... I figured it out... kinda.
I used root explorer to find the XinGothic font. It showed up in system/fonts but it was also found as an apk in system/app/Font_XinGothic. So, I created a new folder in the same format and placed the apk of my font there. I then rebooted and checked font settings and where XinGothic was before now says "HTC Theme Font". I selected that and my custom font was applied. So far, it seems to be evenly implemented across the entire device.
RuLEoF2 said:
Greetings ai.Sanaul...
Yeah, that works but it's very cumbersome. There's at least eight variants of Roboto that I would need find equivalent .ttf versions of to duplicate. Finding a full font family like that without paying $100+ for it is very difficult. On ViperOne 4.3.0, the theme folder that I used only had one .ttf file and somehow, the system adapted it to the required style (ie: bold, italic, etc.) seamlessly across the board including third-party apps.
Thank you very much for your suggestion. I may end up doing that in the end but I was hoping for a method that's a little more plug-and-play.
Click to expand...
Click to collapse
Your Welcome
and for the Font Family problem.
Download this software to your PC (if this trial version didn't works then just tell me) and watch this tutorial video on How to create Font Family.
ai.Sanaul said:
Your Welcome
and for the Font Family problem.
Download this software to your PC (if this trial version didn't works then just tell me) and watch this tutorial video on How to create Font Family.
Click to expand...
Click to collapse
That's a great program. I tried it many years ago and had a lot of fun with it, but not enough to justify the hefty price tag.
Small update...
After unpacking the apk from my theme, I was able to edit the XML so that instead of reading "HTC Theme Font" the display name matches the font name. Easy enough from a PC that I might just create my own collection.
RuLEoF2 said:
That's a great program. I tried it many years ago and had a lot of fun with it, but not enough to justify the hefty price tag.
Small update...
After unpacking the apk from my theme, I was able to edit the XML so that instead of reading "HTC Theme Font" the display name matches the font name. Easy enough from a PC that I might just create my own collection.
Click to expand...
Click to collapse
that's good, Good Luck for that

Categories

Resources