Unrecognized font family on iOS simulator with React Native

后端 未结 14 1487
北海茫月
北海茫月 2020-12-14 05:55

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

14条回答
  •  温柔的废话
    2020-12-14 06:27

    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"
    

提交回复
热议问题