Downloadable Fonts Android

#Google Fonts

Android introduced a downloadable fonts. Android Support Library 26 introduce support for APIs to request fonts from a provider application instead of bundling files into the APK or letting the APK download fonts. The feature is available on devices running Android API versions 14 and higher through the Support Library 26.

Benefits:

  • Reduces the APK size
  • Increases the app installation success rate
  • Improves the overall system health as multiple APKs can share the same font through a provider. This saves users cellular data, phone memory, and disk space. In this model, the font is fetched over the network when needed.

Using Downloadable Fonts via Android Studio:

In the Layout Editor, select a TextView, and then under Properties, select fontFamily > More Fonts.

  1. The Resources window appears.
  2. In the Source drop-down list, select Google Fonts.
  3. In the Fonts box, select a font.
  4. Select Create downloadable font and click OK.

Now Android studio automatically generates the xml for it see the screenshot:

That’s it run your application and see the result :-)

Thanks for reading this article. Be sure to clap to recommend this article if you found it helpful. It means a lot to me.

If you need any help then Join me on Twitter, Linkedin, Github and Facebook.