-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use custom font with RN >= 0.60 --template typescript. react-native.config.js ignored #25697
Comments
You may have an error in path to /fonts. Try this: assets: ['./src/app/assets/fonts/'] |
Link the assets manually using
After that, build again using |
@lapucher That really depends on your file structure and where you place your assets. |
@thehanimo Thank you, that did the job! |
I am facing same issue in RN 0.60.4
My config looks like: module.exports = {
dependency: {
assets: ['./Source/Resources/Fonts/']
},
}; When I run This is my terminal output when I run rn link (I have added react-native link alias as ➜ rn link
➜ rn link
➜ rn link Please help |
got the mistake, Config should look like :: module.exports = {
assets: ['./Source/Resources/Fonts/']
}; Instead ofmodule.exports = {
dependency: {
assets: ['./Source/Resources/Fonts/']
},
}; This should be mentioned in the doc. |
Same Issue, but in my case, config, command and path all are same. Created project using,
Directory structure
|
@Ravi448's solution worked for me |
I got it working for RN v0.60.5 by doing these steps. 1- Created a file in the
3- Link assets to your project by running hopefully it should work fine. |
@alitele Thanks, man. It works. |
@alitele i got this |
Verify that you have actually fonts in the assets/fonts folder. For some reason I had moved/deleted them, and of course the |
I'll also try to add new font to my App. I've found this thread here while I searched for a solution which not use rnpm. But one question here: Isn't |
I am not an expert. But here is how I am thinking, |
@KSahithyan Ok, but as I remember in the right way, Because AndroidX throw an warning if you have manually link something, the question is, if there is a way that I only link my fonts and not all the libraries via Ok, I can answer it myself. It works with |
I've tried your solution, after which both the fonts inside android and ios folders have been copied over successfully. However I still wasn't able to use the font ( |
Is there a way to connect without using link? |
link should not be necessary with RN >= 0.60 |
I am trying to use a custom font in a freshly new React-native project made with the typescript template and I do not succeed to add a custom font family.
All the doc I found told me to use rnpm which has been now deprecated in favor of a react-native.config.js file in the root folder.
I therefore created this file in my project but I did not see anywhere where to tell the react-native builder to read it and therefore I get the error font_name not found
Has anyone any suggestion ?
React Native version:
Steps To Reproduce
The text was updated successfully, but these errors were encountered: