Unrecognized font family – custom fonts in react native.

huangapple go评论67阅读模式
英文:

Unrecognized font family - custom fonts in react native

问题

Error: "Unrecognized font family"
我无法弄清楚为什么我的自定义字体无法被识别。

我已经完成了以下步骤:

  1. 在 assets/fonts 文件夹中添加了自定义字体文件。我尝试了多个不同的字体。
  2. 创建了 react-native.config.js 文件,其中包含 "assets": ['./assets/fonts']
  3. Pod deintegrate / pod install
  4. npx react-native-asset
  5. 更新了 Xcode 中的 plist 值,以指向这些字体

*我正在运行 react-native 0.71.5

英文:

Error: "Unrecognized font family"

I cannot for the life of me figure out why my custom fonts are not being recognized.

I have done the following:

  1. Add custom font files in assets/fonts folder. I tried multiple different fonts.
  2. Create react-native.config.js file with "assets": ['./assets/fonts']
  3. Pod deintegrate / pod install
  4. npx react-native-asset
  5. Update the plist values in xcode to point to the fonts

*I am running react-native 0.71.5

答案1

得分: 1

你试过链接你的资产吗?

npx react-native link

npx react-native-asset

英文:

Did you tried to link your assets ?

npx react-native link 

npx react-native-asset

huangapple
  • 本文由 发表于 2023年4月20日 08:33:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76059740.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定