[FONT][Magisk Module] Google Sans font - systemlessly

Search This thread

Looki75

Senior Member
Apr 1, 2010
1,708
1,450
Hello,

This is a module to install Google Sans font (aka Product Sans) systemlessly through Magisk.
You say: "Yet another Google Sans module"
Well sure, except that I made an important correction in the font design, read below...

So I wanted to install Google Sans font on my device.
You might know that is is not free to use...
All copies I could find on XDA and other places had the same issue.
The issue is that when you place a digit before a linebreak, if you click at the end of the line, the cursor is shown in the middle of the digit (see attached). I don't know if this glitch is only present on OnePlus 3T, but it drove me crazy...
:eek:

Then I spent hours trying to find different copies of that font....
All copies had the same glitch on my device...
So I tried looking for the issue in the font files themselves... and I finally found that the linebreak character (unicode U+0A) had a width defined at 0... whereas in any other font, it has a non-0 value (value depends on the font).
I corrected this issue and now it is working perfect!!!
:good:

Also I corrected the colon for the lockscreen time (U+EE01 in Roboto-light).

So attached is what I believe to be the only Google Sans (aka Product Sans) font module that doesn't have this issue...

Tested only on my OnePlus 3T.
As usual: make backups... blah blah.... I cannot be held responsible... blah blah....
:)


Donations:
www.paypal.me/bulotchka

Thanks to my generous donators:
@matheuseduardo

GitHub:
Repository: https://github.com/Looki75/looki75productsansfont
Report an issue / a bug: https://github.com/Looki75/looki75productsansfont/issues/new
Releases: https://github.com/Looki75/looki75productsansfont/releases/latest

Changelog:
* V20: Thicker underlining line
* V19: Solving underlining issues
* V18: Solved some hyphens alignment issues
* V17: Compatibility with Magisk 20.2
* V16: Correcting the glitches introduced in V15. V16 was generated with my PC which resulted in much lighter files and (hopefully) solving the V15 glitches
* V15: Improved compatibility with latest versions of MIUI roms + fixed south-east and south-west arrows
* V14: Getting back to V10 because I found yet other bugs which just add to the list of issues due to the switch from V10 to V11
* V13: Integrating missing glyphes that I forgot to merge from V10 to V11
* V12: Correcting lockscreen colon issue on certain ROMs
* V11: Updated with latest Google Sans font versions + definitely removed EMOJIs from both Magisk and TWRP zip files
* V10: Correction of small issues with the font itself + removed EMOJIs (the EMOJIs from your ROM will be preserved)
* V9: Additional fonts RobotoCondensed-Medium, RobotoCondensed-MediumItalic, RobotoNum-3L, RobotoNum-3R
* V8: Underline FIX for all weights of font (thanks @rocketsauce83)
* V7: Missing glyphes imported from usual ROBOTO


How to properly install
First of all:
- Install module in Magisk
- Reboot
- On some phones (eg OnePlus), there is the possibility to choose a system-wide font from a selection. In this case, you need to make sure you select "default font" or "Roboto".


How to check if the module works
1. Open Gboard keyboard and look for capitalized letters Q and O. If they look like perfect circles, the module is probably applied correctly.
2. Still in Gboard keyboard, look for figures 6 and 9. If they look like a small perfect circle with added straight line, the module is probably applied correctly.
If checks 1 and 2 failed, double check you did properly install the module.

If you cannot apply the module, then send me:
* a screenshot of Gboard "CAPS" and "figures" screens
* a zip file with the content of your /system/fonts folder
If there is a font that I didn't take into account, I might be able to identify it and patch my module.


If the module seems to be applied correctly, then go further:
3. Look elsewhere in your system. If somewhere Q, O, 6 and 9 don't look like in Gboard, it means a specific font is used in that specific screen/app.

If you think a specific font is used somewhere, then send me:
* a screenshot of the place you where you found a specific font is used
* a zip file with the content of your /system/fonts folder
If there is a font that I didn't take into account, I might be able to identify it and patch my module.


Apps known to use a specific font: aCalendar


Have fun!
Cheers
 

Attachments

  • Screenshot_20180910-141529__01.jpg
    Screenshot_20180910-141529__01.jpg
    23.4 KB · Views: 27,976
  • MAGISK_Looki75_ProductSans_font_V20.zip
    5.2 MB · Views: 42,525
Last edited:

VincentJoshuaET

Senior Member
Jun 5, 2016
1,285
466
24
Angat
Just wanted to add that if anyone has suggestions to further improve, please suggest.
Depending on the suggestion, I might decline (if too much work or if above my competence).

Cheers
Thanks.

Maybe you can make a customized "Condensed" font style? IMO it will look better on some areas like the QS panel and the app drawer.

Also, is DroidSansFallback still needed? It's not mentioned on my ROM's fonts.xml, and I removed it from your module and it still works.

Sent from my Xiaomi Redmi Note 5 using XDA Labs
 

Attachments

  • Screenshot_Pixel_Launcher_20180912-212300.jpg
    Screenshot_Pixel_Launcher_20180912-212300.jpg
    207.2 KB · Views: 13,197
  • Screenshot_Pixel_Launcher_20180912-212341.jpg
    Screenshot_Pixel_Launcher_20180912-212341.jpg
    107.1 KB · Views: 12,892
  • Like
Reactions: tj33 and Looki75

VincentJoshuaET

Senior Member
Jun 5, 2016
1,285
466
24
Angat
Update: I just customized the module and removed the condensed font files. I think I prefer this. (But I guess more people who installed this module would prefer Google Sans everywhere)

Sent from my Xiaomi Redmi Note 5 using XDA Labs
 
  • Like
Reactions: Looki75

Looki75

Senior Member
Apr 1, 2010
1,708
1,450
Thanks.

Maybe you can make a customized "Condensed" font style? IMO it will look better on some areas like the QS panel and the app drawer.

Also, is DroidSansFallback still needed? It's not mentioned on my ROM's fonts.xml, and I removed it from your module and it still works.

Sent from my Xiaomi Redmi Note 5 using XDA Labs

You're right, DroidSansFallback is probably not needed, but I included it just in case...

And, this is true: I couldn't find any condensed version of Google Sans / Product Sans so I just re-used the regular one.
The thing is: I am not a font designer, so I cannot design it. In FontForge, I could apply a 90% factor in the x-values, but then letter width would not be uniform depending if the line is horizontal, oblique or vertical...

If anyone can find and give me the condensed version of this font t(+variants italic, bold, bolditalic...) , I would be more than happy to rework it and include it in my module.
 

VincentJoshuaET

Senior Member
Jun 5, 2016
1,285
466
24
Angat
You're right, DroidSansFallback is probably not needed, but I included it just in case...

And, this is true: I couldn't find any condensed version of Google Sans / Product Sans so I just re-used the regular one.
The thing is: I am not a font designer, so I cannot design it. In FontForge, I could apply a 90% factor in the x-values, but then letter width would not be uniform depending if the line is horizontal, oblique or vertical...

If anyone can find and give me the condensed version of this font t(+variants italic, bold, bolditalic...) , I would be more than happy to rework it and include it in my module.
I guess a good solution is to create another module that still uses the Roboto Condensed fonts (not replacing these fonts)? I already did it myself though, thanks.

Sent from my Xiaomi Redmi Note 5 using XDA Labs
 

VincentJoshuaET

Senior Member
Jun 5, 2016
1,285
466
24
Angat
For comparison:

Sent from my Xiaomi Redmi Note 5 using XDA Labs
 

Attachments

  • Screenshot_Pixel_Launcher_20180912-214021.jpg
    Screenshot_Pixel_Launcher_20180912-214021.jpg
    105.5 KB · Views: 4,820

MobyDuhFreak

Senior Member
Jul 5, 2017
287
64
Do I install this or this magisk module?
Which works best for Resurrection Remix 6.2.0?
 

Attachments

  • Screenshot_Magisk_Manager_20180917-081655.png
    Screenshot_Magisk_Manager_20180917-081655.png
    177.8 KB · Views: 3,730

Looki75

Senior Member
Apr 1, 2010
1,708
1,450
how did you merge , when i was merging from one font family to othere i was getting offset mismatch and suitable invalids errors
and unicode mismatching acc to glyph name

I used FontForge. At first, the merge process ended up with a mess, with Roboto glyphes being GIANTS compared to GoogleSans'...

On a FontForge, forum I learned that the main parameter to adapt is in "Element/Font info/General/EM".
In order to have a nice merge, this parameter has to have the same value in both fonts.

GoogleSans had 1000, Roboto had 2048.
I changed Roboto's to 1000 (at this point FontForge scales all glyphes), generated the modified version.
Then opened GoogleSans, "Element/Merge fonts" then selected the modified Roboto and FontForge integretad all glyphes of Roboto that were not defined in GoogleSans... No error whatsoever, glyphes with same "overall" size.

Of course its not perfect, because of fonts styles being different...
For example upscript figures of Roboto don't fall exactly in the same place than the one of GoogleSans (only ^4 was defined in GoogleSans)... but anyway it's better than what I had before: some weird characters were missing in GoogleSans and - some of my apps using these weird characters - they were displayed as "squares"...

Hope I could help you.
 
  • Like
Reactions: Crescendo Xenomorph

cpt.macp

Senior Member
Aug 2, 2013
563
315
Under Your Bed
I used FontForge. At first, the merge process ended up with a mess, with Roboto glyphes being GIANTS compared to GoogleSans'...

On a FontForge, forum I learned that the main parameter to adapt is in "Element/Font info/General/EM".
In order to have a nice merge, this parameter has to have the same value in both fonts.

GoogleSans had 1000, Roboto had 2048.
I changed Roboto's to 1000 (at this point FontForge scales all glyphes), generated the modified version.
Then opened GoogleSans, "Element/Merge fonts" then selected the modified Roboto and FontForge integretad all glyphes of Roboto that were not defined in GoogleSans... No error whatsoever, glyphes with same "overall" size.

Of course its not perfect, because of fonts styles being different...
For example upscript figures of Roboto don't fall exactly in the same place than the one of GoogleSans (only ^4 was defined in GoogleSans)... but anyway it's better than what I had before: some weird characters were missing in GoogleSans and - some of my apps using these weird characters - they were displayed as "squares"...

Hope I could help you.

if you are rescaling the roboto then i think some characters might be oddly looking because they are resized now
also you can just deodex the apk and see what all character it uses in resources and just copy those gylphs , but yes it will take time
boxes are bascially " .notdef" so missing glyphs are shows as that box or (5 horizontal lines parallel together )
 

mp3deviant721

Senior Member
Jan 4, 2013
1,205
547
Thanks for this very complete font module! I noticed the cursor issue too and some missing glyphs but now it's fixed and works perfectly. I'd recommend this module to anybody who asks about it!
 

taxuezju18

Member
Sep 25, 2015
13
1
Read the OP for understanding
I have read the OP,I have known this module fixed a problem. When I extract this module, I found the fonts named Roboto, not GoogleSans, and compared with them, find their versions are different. GoogleSans is newer than Roboto, I want to know whether Roboto is the GoogleSans in Android P.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 153
    Hello,

    This is a module to install Google Sans font (aka Product Sans) systemlessly through Magisk.
    You say: "Yet another Google Sans module"
    Well sure, except that I made an important correction in the font design, read below...

    So I wanted to install Google Sans font on my device.
    You might know that is is not free to use...
    All copies I could find on XDA and other places had the same issue.
    The issue is that when you place a digit before a linebreak, if you click at the end of the line, the cursor is shown in the middle of the digit (see attached). I don't know if this glitch is only present on OnePlus 3T, but it drove me crazy...
    :eek:

    Then I spent hours trying to find different copies of that font....
    All copies had the same glitch on my device...
    So I tried looking for the issue in the font files themselves... and I finally found that the linebreak character (unicode U+0A) had a width defined at 0... whereas in any other font, it has a non-0 value (value depends on the font).
    I corrected this issue and now it is working perfect!!!
    :good:

    Also I corrected the colon for the lockscreen time (U+EE01 in Roboto-light).

    So attached is what I believe to be the only Google Sans (aka Product Sans) font module that doesn't have this issue...

    Tested only on my OnePlus 3T.
    As usual: make backups... blah blah.... I cannot be held responsible... blah blah....
    :)


    Donations:
    www.paypal.me/bulotchka

    Thanks to my generous donators:
    @matheuseduardo

    GitHub:
    Repository: https://github.com/Looki75/looki75productsansfont
    Report an issue / a bug: https://github.com/Looki75/looki75productsansfont/issues/new
    Releases: https://github.com/Looki75/looki75productsansfont/releases/latest

    Changelog:
    * V20: Thicker underlining line
    * V19: Solving underlining issues
    * V18: Solved some hyphens alignment issues
    * V17: Compatibility with Magisk 20.2
    * V16: Correcting the glitches introduced in V15. V16 was generated with my PC which resulted in much lighter files and (hopefully) solving the V15 glitches
    * V15: Improved compatibility with latest versions of MIUI roms + fixed south-east and south-west arrows
    * V14: Getting back to V10 because I found yet other bugs which just add to the list of issues due to the switch from V10 to V11
    * V13: Integrating missing glyphes that I forgot to merge from V10 to V11
    * V12: Correcting lockscreen colon issue on certain ROMs
    * V11: Updated with latest Google Sans font versions + definitely removed EMOJIs from both Magisk and TWRP zip files
    * V10: Correction of small issues with the font itself + removed EMOJIs (the EMOJIs from your ROM will be preserved)
    * V9: Additional fonts RobotoCondensed-Medium, RobotoCondensed-MediumItalic, RobotoNum-3L, RobotoNum-3R
    * V8: Underline FIX for all weights of font (thanks @rocketsauce83)
    * V7: Missing glyphes imported from usual ROBOTO


    How to properly install
    First of all:
    - Install module in Magisk
    - Reboot
    - On some phones (eg OnePlus), there is the possibility to choose a system-wide font from a selection. In this case, you need to make sure you select "default font" or "Roboto".


    How to check if the module works
    1. Open Gboard keyboard and look for capitalized letters Q and O. If they look like perfect circles, the module is probably applied correctly.
    2. Still in Gboard keyboard, look for figures 6 and 9. If they look like a small perfect circle with added straight line, the module is probably applied correctly.
    If checks 1 and 2 failed, double check you did properly install the module.

    If you cannot apply the module, then send me:
    * a screenshot of Gboard "CAPS" and "figures" screens
    * a zip file with the content of your /system/fonts folder
    If there is a font that I didn't take into account, I might be able to identify it and patch my module.


    If the module seems to be applied correctly, then go further:
    3. Look elsewhere in your system. If somewhere Q, O, 6 and 9 don't look like in Gboard, it means a specific font is used in that specific screen/app.

    If you think a specific font is used somewhere, then send me:
    * a screenshot of the place you where you found a specific font is used
    * a zip file with the content of your /system/fonts folder
    If there is a font that I didn't take into account, I might be able to identify it and patch my module.


    Apps known to use a specific font: aCalendar


    Have fun!
    Cheers
    15
    thank you so much! any chance to make a twrp flashable version of the zip? thanks!

    @All,

    UPDATE: V8 with Underline FIX for all weights of font (thanks @RocketSauce83) + TWRP-flashable ZIP made available

    Enjoy ;)
    12
    Guys,

    I'm really sorry... I had to update once more...

    UPDATE: V14 - basically getting back to V10 because I found yet other bugs which just add to the list of issues due to the switch from V10 to V11...

    Better I should have stick with V10 :crying::crying::crying:
    12
    UPDATE: V16 - basically correcting the glitches introduced in V15. V16 was generated with my PC which resulted in much lighter files and (hopefully) solving the V15 glitches

    Download from first post.

    Enjoy :)
    11
    Everyone,

    UPDATE: V13 - integrating missing glyphes that I forgot to merge from V10 to V11... sorry guys...

    @DvLAx3l thanks for your help in troubleshooting the latest remastered version... :eek::good: