Downloadable Fonts In Android Studio

Make your app more beautiful with downloadable font’s..

Danish Amjad
AndroidPub
Published in
2 min readMar 30, 2018

--

#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.

Screen Shot : Android Studio XML Layout
  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.
Screen Shot : Android Studio Font’s Resources
  • Now Android studio automatically generates the xml for it see the below screenshot:
Screen Shot : Android Studio XML Layout Font Result

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

If you want to learn more about downloadable font’s then check it out the official documentation below:

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 Subscribe to my Youtube Channel.

--

--

Danish Amjad
AndroidPub

Senior Mobile Engineer (Android). Open Source Contributor, Technical Writer, ✉️ Dani.amjad12@gmail.com 🔗 https://danishamjad12.github.io