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?
1. Open your project in Xcode and make a fonts folder. You will drag and drop your font files into this newly created folder.
Navigate to android/app/src/main/assets/fontsAnd remove the fonts you want out. And that'll be all.
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!
Implement the following code in your appdelegate file
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@"Family name: %@", name);
}
}
You should use FONT FAMILY NAME instead of your font file name like the following
fontFamily: "FuturaBT-Book"
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