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

Viewed 4164

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.

2 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!!

I've also was wondering how to use it, for personal use though. Oddly enough I used this and it works perfectly fine, though I own a pixel device and am pretty sure this won't work on other devices. Here's what I used for the TextView:

    android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.Button"
Related