Unrecognized font family on iOS simulator with React Native

后端 未结 14 1507
北海茫月
北海茫月 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:28

    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:

    • Double check the font files are included in the Target in XCode
    • Make sure they are included in the step "Copy Bundle Resources" (add files, not folders)
    • Include them in the Info.plist of the app
    • Find the name of the Font through FontBook or with some log statements in your AppDelegate

    Explained in more detail here: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/

    Good luck!

提交回复
热议问题