expo: Can't use loaded fonts as per documentation
Following the Using Custom Fonts guide to load a custom font and then using fontFamily: 'my-font-name' in a StyleSheet always results in the following error message:
fontFamily ‘my-font-name’ is not a system font and has not been loaded through Exponent.Font.loadAsync.
However, if I use fontFamily: Font.style('my-font-name').fontFamily it works correctly. I’m not sure if this means the documentation is incorrect (maybe a breaking change was introduced recently?) or if this is some sort of bug.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (7 by maintainers)
One thing that might help is in old versions of the documentation there should be a big warning banner at the top that says something about this version being outdated. Might cause people to look twice at the documentation version
Hi All,
I’m having the same problem. Lost tow hours on this. Here is my code. Any idea?
And My package.json
The project was created on v17 only about a month ago, so no upgrades have happened yet (although I see v18 is out now). Not sure how the old package is in there, but glad it’s solved now. Thanks for pointing me in the right direction!