FORUMS
Remove All Ads from XDA

[ROOT][5.0+] Font Picker for Android [07.10.2017]

1,652 posts
Thanks Meter: 3,619
 
By IgorEisberg, Senior Member on 27th April 2016, 11:27 PM
Post Reply Email Thread
ROM COOKERS: You can embed this package into your custom ROM, you don't need my permission. A credit would be appreciated, though.

As some of you probably know, the SomcFontSelector.apk in the Japanese firmware for the latest devices is pretty useless to us. It has only 4 built-in fonts with no options for other languages and no possibility to create font packs, or anything similar. So... I coded one of my own.

I present you my own Font Picker (formerly, Font Selector). Completely remade in Android Studio. Supports specialized and very flexible font packs that are specifically made for this selector.
I also include some ready-to-use font packs and there are more to come, as well as a quick guide for creating your own font packs for this selector.

REQUIREMENTS:
  • Any device running Android 5.0 or newer. (May not work properly on devices with MediaTek SoC)
  • Rooted + Custom Recovery
  • Deodexed
  • Disabled Signature Verification (Patched compareSignatures in 'services.jar')
  • (Android 7.0+) SELinux on Permissive Mode

Screenshots from my Xperia Z1 customized stock-based ROM, showing off the Biko font pack:





There are 2 variants with only one difference: a Universal one with a launcher icon, the other is for Xperia devices, and it doesn't have a launcher icon. Instead, a "Font" shortcut will automatically appear in your Settings->Display. And that's the reason why I kept the package name "com.sonymobile.fontselector" for this variant, because Xperia's Settings app checks if it's installed.
If the shortcut doesn't appear, flash the Universal variant. That will place a "Font" launcher icon instead.

Downloads:

Xperia: Font Picker (with a Settings->Display shortcut)
  • Newer device than the ones below: Any firmware.
  • Xperia Z3+/Z4: Any 32.x.X.x.x (Android 5.1.1+) firmware.
  • Xperia Z2/Z2a/Z3: Any 23.5.X.x.x (Android 6.0.1+) firmware.
Universal: Font Picker (with a Launcher icon)
  • Any device running Android 5.0+

Font Packs (by Dr. Death):
http://forum.xda-developers.com/cros...peria-t3525492

Font Packs (by Igor Eisberg & Metallijim): [Not maintained]
  • Biko
    The font used in the screenshots, my personal favorite.

Your Own Font Packs:
  • Download and extract this compilation: AdvancedApkTool-FontPicker.zip (Huge thanks to the creators of Advanced ApkTool and Apktool, makes life much easier)
  • Browse to "AdvancedApkTool/3-Out/MyFont.apk".
  • assets/fonts: Copy-paste here variants of a single kind of fonts (i.e. MyFont-Regular, MyFont-Bold, MyFont-Italic, etc)
  • AndroidManifest.xml: Change the "package" from "com.mysite.myfont" to any package name you want (it has to be unique)
  • res/values/strings.xml: Change the "font_name" from "My Font" to anything you want.
  • res/xml/fonts.xml: Change all of the file names to the file names of your fonts (i.e. "MyFont-Regular.ttf" to "Rosemary-Regular.ttf")
  • Go back to "AdvancedApkTool" folder and run "Advanced ApkTool.exe".
  • Select "3 - Recompile Files", and then ENTER.
  • Select "1 - MyFont.apk", and then ENTER.
  • Select "4 - Recompile, Sign And Then Zipalign", and then ENTER.
  • Press the Y key, and the ENTER.
  • When the recompilation is complete, go to "4-Done" folder, rename "MyFont.apk" to anything you want and copy it to your phone.
  • Install as any other APK.
.
The Following 70 Users Say Thank You to IgorEisberg For This Useful Post: [ View ] Gift IgorEisberg Ad-Free
 
 
28th April 2016, 06:10 AM |#2  
Recognized Contributor
Flag Hervey Bay
Thanks Meter: 821
 
More
Dows this use .ttf files for the font?
28th April 2016, 09:11 AM |#3  
amey2606's Avatar
Senior Member
Flag Navi Mumbai
Thanks Meter: 98
 
More
Great work man.
Just one question, i use iFont for changing my fonts.
Will flashing this conflict with iFont.?
And will this work on a normal Odexed rom.?

Thanks. 😊
28th April 2016, 09:32 AM |#4  
whalesplaho's Avatar
Senior Member
Flag Treasure Island
Thanks Meter: 2,525
 
More
Great job here... Im using ifont but doesnt change all system fonts, would like to use dis buh can i use ttf font with dis or make it compatible with ttf font. Thanks
28th April 2016, 10:08 AM |#5  
IgorEisberg's Avatar
OP Senior Member
Thanks Meter: 3,619
 
Donate to Me
More
Quote:
Originally Posted by amey2606

Great work man.
Just one question, i use iFont for changing my fonts.
Will flashing this conflict with iFont.?
And will this work on a normal Odexed rom.?

Thanks.

Yes, once you flash this ZIP it will replace stuff in system partition, but after that no other changes are made to the system partition by the app itself. iFont, however, physically replaces fonts in order to install them, which means my selector takes priority as soon as you select a font pack. There shouldn't be any crashes, if that's what you ask.
The even better thing is that the font selector uses only the characters that are avaiable in the fonts pack, and for the missing characters it falls back to Roboto. Installing fonts with iFonts does not, they will fall back to some ugly fallback font instead.
It will work on an odexed ROM up to the point you wipe the dalvik-cache. Once you wiped the dalvik-cache, you'll be stuck in a bootloop (signature checking will fail, thus has to be patched). This is actually true for any other modified/third-party APK that you attempt to flash on an odex ROM

Quote:
Originally Posted by whalesplaho

Great job here... Im using ifont but doesnt change all system fonts, would like to use dis buh can i use ttf font with dis or make it compatible with ttf font. Thanks

Quote:
Originally Posted by Beetle84

Dows this use .ttf files for the font?

Unlike what iFont made you believe, a font in Android is not a single TTF file, it has variants like Light, Bold, Italic, BoldItalic, etc. And these variants have to be mapped to the corresponding font families they should replace. You can decompile one of my font packs to see how a font pack actually works. The key file is the "/res/xml/fonts.xml".
Here's how this XML file should look like (I setup the Biko font to only replace Sans Serif, Sans Serif Condensed, SST and SST Condensed fonts, but you can actually replace even more less-used fonts):
Code:
<?xml version="1.0" encoding="utf-8"?>
<familyset>
    <family name="sans-serif">
        <font weight="100" style="normal">Biko-Light.ttf</font>
        <font weight="100" style="italic">Biko-LightItalic.ttf</font>
        <font weight="300" style="normal">Biko-Light.ttf</font>
        <font weight="300" style="italic">Biko-LightItalic.ttf</font>
        <font weight="400" style="normal">Biko-Regular.ttf</font>
        <font weight="400" style="italic">Biko-Italic.ttf</font>
        <font weight="500" style="normal">Biko-Regular.ttf</font>
        <font weight="500" style="italic">Biko-Italic.ttf</font>
        <font weight="900" style="normal">Biko-Black.ttf</font>
        <font weight="900" style="italic">Biko-BlackItalic.ttf</font>
        <font weight="700" style="normal">Biko-Bold.ttf</font>
        <font weight="700" style="italic">Biko-BoldItalic.ttf</font>
    </family>
    <family name="sans-serif-condensed">
        <font weight="300" style="normal">Biko-Light.ttf</font>
        <font weight="300" style="italic">Biko-LightItalic.ttf</font>
        <font weight="400" style="normal">Biko-Regular.ttf</font>
        <font weight="400" style="italic">Biko-Italic.ttf</font>
        <font weight="700" style="normal">Biko-Bold.ttf</font>
        <font weight="700" style="italic">Biko-BoldItalic.ttf</font>
    </family>
    <family name="x-sst">
        <font weight="100" style="normal">Biko-Light.ttf</font>
        <font weight="100" style="italic">Biko-LightItalic.ttf</font>
        <font weight="300" style="normal">Biko-Light.ttf</font>
        <font weight="300" style="italic">Biko-LightItalic.ttf</font>
        <font weight="400" style="normal">Biko-Regular.ttf</font>
        <font weight="700" style="normal">Biko-Bold.ttf</font>
        <font weight="500" style="normal">Biko-Regular.ttf</font>
        <font weight="500" style="italic">Biko-Italic.ttf</font>
        <font weight="900" style="normal">Biko-Bold.ttf</font>
        <font weight="900" style="italic">Biko-BoldItalic.ttf</font>
    </family>
    <family name="x-sst-condensed">
        <font weight="400" style="normal">Biko-Regular.ttf</font>
        <font weight="700" style="normal">Biko-Bold.ttf</font>
    </family>
</familyset>
The Following 6 Users Say Thank You to IgorEisberg For This Useful Post: [ View ] Gift IgorEisberg Ad-Free
28th April 2016, 01:32 PM |#6  
whalesplaho's Avatar
Senior Member
Flag Treasure Island
Thanks Meter: 2,525
 
More
Quote:
Originally Posted by IgorEisberg

Yes, once you flash this ZIP it will replace stuff in system partition, but after that no other changes are made to the system partition by the app itself. iFont, however, physically replaces fonts in order to install them, which means my selector takes priority as soon as you select a font pack. There shouldn't be any crashes, if that's what you ask.
The even better thing is that the font selector uses only the characters that are avaiable in the fonts pack, and for the missing characters it falls back to Roboto. Installing fonts with iFonts does not, they will fall back to some ugly fallback font instead.
It will work on an odexed ROM up to the point you wipe the dalvik-cache. Once you wiped the dalvik-cache, you'll be stuck in a bootloop (signature checking will fail, thus has to be patched). This is actually true for any other modified/third-party APK that you attempt to flash on an odex ROM



Unlike what iFont made you believe, a font in Android is not a single TTF file, it has variants like Light, Bold, Italic, BoldItalic, etc. And these variants have to be mapped to the corresponding font families they should replace. You can decompile one of my font packs to see how a font pack actually works. The key file is the "/res/xml/fonts.xml".
Here's how this XML file should look like (I setup the Biko font to only replace Sans Serif, Sans Serif Condensed, SST and SST Condensed fonts, but you can actually replace even more less-used fonts):

Code:
<?xml version="1.0" encoding="utf-8"?>
<familyset>
    <family name="sans-serif">
        <font weight="100" style="normal">Biko-Light.ttf</font>
        <font weight="100" style="italic">Biko-LightItalic.ttf</font>
        <font weight="300" style="normal">Biko-Light.ttf</font>
        <font weight="300" style="italic">Biko-LightItalic.ttf</font>
        <font weight="400" style="normal">Biko-Regular.ttf</font>
        <font weight="400" style="italic">Biko-Italic.ttf</font>
        <font weight="500" style="normal">Biko-Regular.ttf</font>
        <font weight="500" style="italic">Biko-Italic.ttf</font>
        <font weight="900" style="normal">Biko-Black.ttf</font>
        <font weight="900" style="italic">Biko-BlackItalic.ttf</font>
        <font weight="700" style="normal">Biko-Bold.ttf</font>
        <font weight="700" style="italic">Biko-BoldItalic.ttf</font>
    </family>
    <family name="sans-serif-condensed">
        <font weight="300" style="normal">Biko-Light.ttf</font>
        <font weight="300" style="italic">Biko-LightItalic.ttf</font>
        <font weight="400" style="normal">Biko-Regular.ttf</font>
        <font weight="400" style="italic">Biko-Italic.ttf</font>
        <font weight="700" style="normal">Biko-Bold.ttf</font>
        <font weight="700" style="italic">Biko-BoldItalic.ttf</font>
    </family>
    <family name="x-sst">
        <font weight="100" style="normal">Biko-Light.ttf</font>
        <font weight="100" style="italic">Biko-LightItalic.ttf</font>
        <font weight="300" style="normal">Biko-Light.ttf</font>
        <font weight="300" style="italic">Biko-LightItalic.ttf</font>
        <font weight="400" style="normal">Biko-Regular.ttf</font>
        <font weight="700" style="normal">Biko-Bold.ttf</font>
        <font weight="500" style="normal">Biko-Regular.ttf</font>
        <font weight="500" style="italic">Biko-Italic.ttf</font>
        <font weight="900" style="normal">Biko-Bold.ttf</font>
        <font weight="900" style="italic">Biko-BoldItalic.ttf</font>
    </family>
    <family name="x-sst-condensed">
        <font weight="400" style="normal">Biko-Regular.ttf</font>
        <font weight="700" style="normal">Biko-Bold.ttf</font>
    </family>
</familyset>


Nicely said. I do noticed more dan one font in Android font folder too... Dnt know if its possible if we upload our ttf fonts and maybe yhu make dem compatible with yur font changer please or a tut on how we can make ours. Thanks
The Following User Says Thank You to whalesplaho For This Useful Post: [ View ] Gift whalesplaho Ad-Free
28th April 2016, 02:30 PM |#7  
IgorEisberg's Avatar
OP Senior Member
Thanks Meter: 3,619
 
Donate to Me
More
Quote:
Originally Posted by whalesplaho

Nicely said. I do noticed more dan one font in Android font folder too... Dnt know if its possible if we upload our ttf fonts and maybe yhu make dem compatible with yur font changer please or a tut on how we can make ours. Thanks

If you have some readable fonts, that also have at least Regular, Italic, Bold and BoldItalic variants, I'll make you a font pack. It takes no effort anyway.
EDIT: I can also generate all of these variants myself if you at least have the Regular variant. Just make sure it's readable font, not a decorative one.
The Following 2 Users Say Thank You to IgorEisberg For This Useful Post: [ View ] Gift IgorEisberg Ad-Free
28th April 2016, 08:58 PM |#8  
Metallijim's Avatar
Senior Member
Flag Bedford
Thanks Meter: 1,078
 
Donate to Me
More
Nice work, feel free to use some of my font zips however you wish.

Sent from my D6603 using XDA-Developers mobile app
The Following 2 Users Say Thank You to Metallijim For This Useful Post: [ View ] Gift Metallijim Ad-Free
28th April 2016, 09:13 PM |#9  
IgorEisberg's Avatar
OP Senior Member
Thanks Meter: 3,619
 
Donate to Me
More
Quote:
Originally Posted by Metallijim

Nice work, feel free to use some of my font zips however you wish.

Sent from my D6603 using XDA-Developers mobile app

Thanks mate. My time is quite limited, hope you can make some font packs as well, I think it's time to move to this font selector in place of flashing ZIPs.

Those who have downloaded the Font Selector already, please redownload and reflash. I fixed the font packs not sorting alphabetically.
The Following 5 Users Say Thank You to IgorEisberg For This Useful Post: [ View ] Gift IgorEisberg Ad-Free
28th April 2016, 10:20 PM |#10  
Metallijim's Avatar
Senior Member
Flag Bedford
Thanks Meter: 1,078
 
Donate to Me
More
Quote:
Originally Posted by IgorEisberg

Thanks mate. My time is quite limited, hope you can make some font packs as well, I think it's time to move to this font selector in place of flashing ZIPs.

Those who have downloaded the Font Selector already, please redownload and reflash. I fixed the font packs not sorting alphabetically.

Makes it feel more like a part of the software (like Samsung do) I'll see what I can do in my spare time.

Sent from my D6603 using XDA-Developers mobile app
The Following 3 Users Say Thank You to Metallijim For This Useful Post: [ View ] Gift Metallijim Ad-Free
28th April 2016, 11:11 PM |#11  
whalesplaho's Avatar
Senior Member
Flag Treasure Island
Thanks Meter: 2,525
 
More
Quote:
Originally Posted by IgorEisberg

If you have some readable fonts, that also have at least Regular, Italic, Bold and BoldItalic variants, I'll make you a font pack. It takes no effort anyway.
EDIT: I can also generate all of these variants myself if you at least have the Regular variant. Just make sure it's readable font, not a decorative one.

here is a zip file of my fonts.... i still have some in apk format, dnt know how dah ll work for yhu!
thanks a ton.
https://tusfiles.net/j5sa7j19vs2m
The Following User Says Thank You to whalesplaho For This Useful Post: [ View ] Gift whalesplaho Ad-Free
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes