未识别的font-font'开放式bold'

发布于 2025-02-08 14:41:21 字数 504 浏览 1 评论 0原文

我正在尝试将自定义字体添加到我的Bare React本地项目中,并且我一直在iOS Similator上获得未识别的字体家庭“开放式”。我在资产文件夹中添加了字体折叠,并使用文件open-sans.ttf和open-sans-bold.ttf我也有react> react-native.config.js在下面的内容下,

module.exports = {
  project: {
    ios: {},
    android: {},
  },
  assets: ['./assets/fonts/'],
};

我运行npx react-native链接,然后检查了info.plist文件,并且我的字体< key gt; uiappfonts</key> 我尝试了不同的解决方案,但它们都不适用于我。

I am trying to add custom fonts to my bare react native project and I keep getting Unrecognized font-family 'open-sans-bold ' on the ios similator. I added the fonts fold in my assets folder with files open-sans.ttf and open-sans-bold.ttf I also have react-native.config.js with the content below

module.exports = {
  project: {
    ios: {},
    android: {},
  },
  assets: ['./assets/fonts/'],
};

I run npx react-native link and I checked the info.plist file and I have the fonts in <key>UIAppFonts</key> I tried different solutions but none of them worked for me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文