-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Custom fontFamily for Text not working in either iOS or Android #17641
Comments
Can you try to match {
fontFamily: 'Nunito-Reqular' // if filename is Nunito-Reqular.ttf
} {
fontFamily: 'Nunito-Bold' // if filename is Nunito-Bold.ttf
} |
@facebook-github-bot duplicate #15266 |
Duplicate of #15266 |
@lwinkyawmyat I'm unsure if it's a duplicate, since I don't have |
i am facing the same issue, tried everything but dint get any solution. |
I found out that font names on ios are different from the file name.
worked for me so far |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: macOS High Sierra 10.13.2
Node: 9.4.0
Yarn: 1.3.2
npm: 5.6.0
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.52.0 => 0.52.0
Steps to Reproduce
assets/fonts/
directory (here are the contents of that directory)package.json
:react-native link
./gradlew clean
fromandroid
directory, fresh install ofnode_modules
from scratch, fresh install of pods fromandroid
directory, restart both Xcode and Android Studio, reset npm cache, uninstall and reinstall app on variety of emulators and devicesText.defaultProps.style = {fontFamily: 'Nunito'};
in root component (App.js
){fontFamily: 'Nunito'}
style for a singleText
componentExpected Behavior
I expected globally setting
Text.defaultProps.style = {fontFamily: 'Nunito'};
to result in the font being applied everywhere in my app, or at the very least setting{fontFamily: 'Nunito'}
style for a singleText
component to work.Actual Behavior
In all cases, I still only observe my app using the default RN font family.
The text was updated successfully, but these errors were encountered: