-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unrecognized font family #18269
Comments
Looks to me that you are missing the native side step of adding it to the Info.plist: https://medium.com/react-native-training/react-native-custom-fonts-ccc9aacf9e5e If following the linked guide fixes the issue for you, please close it afterwards. |
The third step in the above mentioned steps adds the font in info.plist. Extract from my info.plist Still getting the same issue. |
Ok, then I suggest you double check in the Font Book that the name is the right one; there are instances when the name of a font is not the same in Android & iOS (ex. |
@pKanijam in that window (FontBook), go to View -> Show font info (I don't know the exact name in the menu) and you should see something like this: And you should use the PostScript Name and if this doesn't work, you can use the next code:
That you should place in "AppDelegate.m", after |
Exactly as @LuisUrrutia is saying 👍 An other link that should explain the 'name difference' visually is in the example here: https://hiddentao.com/archives/2017/03/10/get-custom-fonts-working-in-react-native/ . (as you can see the FontFamily name is different) |
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest stable release? Thank you for your contributions. |
Issue resolved following the instructions above. Thanks @LuisUrrutia, your instructions helped me to find the proper font name to use for iOS build. Thanks @kelset, your last link helped me to organise my stylesheet properly and get the proper fonts on both iOS and android. |
Thank you very very much @LuisUrrutia , you save my life. I spend more then 3 hour to find YOUR SOLUTION.. |
Getting error Unrecognized font family 'Museo Sans 500' in iOS simulator only. App works fine on android emulator.
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 9.3.0
Yarn: Not Found
npm: 5.7.1
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.53.2 => 0.53.2
Expected Behavior
App should properly open the app.
Actual Behavior
getting red screen.
Steps to Reproduce
"assets": [
"./assets/fonts/"
]
} in package.json
react-native link
The text was updated successfully, but these errors were encountered: