I'm trying to use a custom font on my app but it doesn't work. I have followed numerous steps from other similar questions but nothing works.
I'm not getting any error.
The path to the assets folder: Assets source
This is what I tried:
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./src/assets/fonts']
};
info Linking assets to ios project
info Linking assets to android project
success Assets have been successfully linked to your project
<Text style={[styles.texto_Titulo, {fontFamily: "LatoBlack"}]}>
ENTRADA
</Text>
Why is this not working?
Okay so this happens to be a current bug for React Native 0.62. The workaround for this problem is copying the assets/fonts folder to /android/app/src/main/ path. This fixed the problem.
My solution was to remove fontWeight from my text styles. Seems font family does not work if fontWeight is provided
https://github.com/facebook/react-native/issues/25852#issuecomment-826526064
still i have face same issue on 0.64.0
please copy paste your font file to
android/app/src/main/assets/fonts
if you have not find the folder of asset inside main folder. please create it assets/fonts folder
Then do
react-native link
its working now without adding any config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With