O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Including custom fonts on Android

In this recipe, we will include the same fonts we included on iOS, and we will use exactly the same example app.

Importing the fonts is pretty straightforward, but we need to follow some guidelines in order to make it work. There are some limitations on Android; we will learn a workaround to solve the issue regarding font weight.

Getting ready

As with the previous recipe, we need some fonts to work with. Android supports TTF and OTF formats. For this example, we will use the same fonts we did in the previous recipe.

How to do it...

To include custom fonts on Android, let's perform the following steps:

  1. We need to copy the font files to project_name/android/app/src/main/assets/fonts. This is the exact location where we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required