Unrecognized font family on iOS simulator with React Native

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

    You can also try this, specify your fonts this way, map them into three styles:

    For instance Gilroy-SemiBoldItalic

    // iOS
    {
      fontFamily: 'Gilroy',
      fontWeight: '600',
      fontStyle: 'italic'
    }
    
    // Android
    {
      fontFamily: 'Gilroy-SemiBoldItalic'
    }
    

    You can also create a function to generate styles for a font with given weight and style.

    Hope this helps

提交回复
热议问题