Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use new Google's Sans font in my Android App?

How can I use the font seen in fresh Google's apps like Phone, Contact and Google Fit in my Android App? Is there some new textAppearance value for this? Here's the preview of desired font (titles): Google's new material font

As I could find out, this font is called something like "Google Sans".

Thanks.

like image 559
oleynikd Avatar asked Nov 17 '22 03:11

oleynikd


1 Answers

I too wondered here and there to know how to use that font. I came to know that you cannot use it legally and for official use but if you have personal use then you can use this answer.
I am adding this answer only to answer your question but not to allow everyone to use that font!!

Here are the steps:

  • Download the font zip file by checking out my blog post

  • Make directory named font under res folder and add the TTF files under it.

  • Now add the font to the TextView using this attribute:

android:fontFamily="@font/google_sans"

I am sure that this will work for all devices.
But again I tell you, don't use it for professional work!!

like image 102
Gourav Avatar answered Dec 11 '22 00:12

Gourav