Custom fonts
Last modified on Wed 27 Jan 2021

For this tutorial we will be using custom font that can be downloaded here https://www.onlinewebfonts.com/download/3a88649e176a40a6d80b395ca0ae430d

Setup

module.exports = {
  project: {
    ios: {},
    android: {}, // grouped into "project"
  },
  assets: ["./assets/fonts/"], // stays the same
};

react-native link

fontFamily: DINNextLTPro-Bold;

Note

When using custom fonts, css rule font-weight doesn't apply. To use different font weight we need to add separate font file with that weight, and then change the font-family in css. For example here https://fontshub.pro/font/din-next-lt-pro-download you can see a lot of variations of a single font. So if you need different font-weight - you will need to download it too and after that you can use it like fontFamily: DINNextLTPro-Regular; or fontFamily: DINNextLTPro-Light;

Documentation

For more details or if you have RN version < 0.60 - check this article: * Custom fonts in react native