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 iOS

At some point, we are going to need to display text with a custom font family; until now, we have been using the default font, but we can use any other that we like.

In this recipe, we will import a few fonts in Xcode and then we will display a text using different font families. We will also use different styles of a single font, such as bold and italic.

Getting ready

In order to work on this example, we need some fonts. You can use whatever fonts you want; I recommend going to Google fonts and downloading your favorites. For this recipe, we will use the Roboto font. Just make sure to use TTF. I've already prepared a few fonts that you can download from PacktPub's website.

Once you have the fonts ready, let's create ...

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