For those facing problems with iOS only - which sometimes does not recognize the fontFamily name correctly:
The only solution that solved my problem was to log all the fonts to find out correct naming
(make sure you do the steps below only after adding the assets/fonts and running the react-native link
):
Anyway, to log them, open the appName.xcworkspace
file with xcode and then edit AppDelegate.m putting this lines at the end of the didFinishLaunchingWithOptions
method (and before the return statement):
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
}
}
So, when you run the app (from xcode) it outputs something like this:
This way, I can use the fontFamily Barow-Light or Zapfino inside my react-native styles
Hope it helped!
sans-serif-thin
? – Simasroboto
(except in the guidelines). Answering question 2: google it. It's unofficially possible and there are multiple questions about it. – Simas