Created
March 2, 2019 23:23
-
-
Save dayaki/d981971db9f33e35aa7a259f4d6d483f to your computer and use it in GitHub Desktop.
Use custom fonts in React Native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Put all your fonts in you React-Native project directory | |
`./assets/fonts/` | |
2. Add the following line in your package.json | |
``` | |
"rnpm": { | |
"assets": ["./assets/fonts"] | |
} | |
``` | |
3. finally run in the terminal from your project directory | |
`react-native link` | |
4. to use it declare this way in your styles | |
`fontFamily: 'your-font-name without extension'` | |
If your font is Raleway-Bold.ttf then, | |
`fontFamily: 'Raleway-Bold'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./assets/fonts/