I am trying to use the custom font called times-news-roman.
I created react-native.config.js file, here is what's inside of it
module.exports = {
project: {
ios: {},
android: {}, // grouped into "project"
},
assets: ['./assets/fonts/'], // stays the same
};
I also created my assets folder in the root of the app.
I am trying to use this custom font like this:
headerTextLight: {
color: 'black',
fontWeight: 'bold',
fontSize: 30,
paddingLeft: 10,
paddingTop: 10,
fontFamily: 'times-new-roman',
},
But I am getting this error:
Unrecognized font family 'times-new-roman'
I am using "react-native": "^0.63.3"
. Any suggestions please?
question from:
https://stackoverflow.com/questions/65905559/react-native-fontfamily-is-not-working-as-it-should 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…