Custom Fonts in React Native Android

Version of react-native > 0.60

Firstly download your fonts from Google Fonts. Suppose you have downloaded Lato font. Then create an assets folder, react-native.config.js file into your react-native's root directory and copy all the .ttf files extracted from downloaded zip file. Add following codes into react-native.config.js file.

module.exports = {
  project: {
    ios: {},
    android: {}
  },
  assets: ['./assets/fonts/']
}

Then run this command in your project's directory.

$ react-native link

Add fontFamily: 'Lato-Bold' in your StyleSheet and run

$ react-native run-android

Hopefully you can see your added font.

Comments

Shahnawaz Hossan 2019-2024 | Crafted with