I've added Linux Biolinum fonts (http://www.dafont.com/linux-biolinum.font, LinBiolinum_R.ttf, LinBiolinum_RB.ttf) to my React Native project. Android version is OK. But on iOS I always see error "Unrecognized font family LinBiolinum_R".
My style is:
customFontRegular: {
fontFamily: 'LinBiolinum_R',
},
I've tryied to rename font file and font family to "MyFont", but the error appears again on iOS.
Any ideas?
Implement the following code in your appdelegate file
You should use FONT FAMILY NAME instead of your font file name like the following
On Android it takes the name of the file and you are done. On iOS however it is a bit more complex.
There are a few steps you should take:
Explained in more detail here: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/
Good luck!
For me, changing the name of the file to the name of the Font (displayed as I open the file) did it.
If you are running react-native ios simulator, you should include fonts in the xcode project directory.
react-native link react-native-vector-icons doing so , will add the fonts to Resources folder in xcode project and also add fonts to pinfo list.
Add this to your
package.json
and then run
react-native link
in command lineFor IOS,
Make sure you add fonts to resource Copy Bundle Resources
Make sure you have folder Resources in Xcode, somehow it was deleted and you must create, import fonts to that folder manually
Make sure using name of Family in Font book