Skip to content

Instantly share code, notes, and snippets.

@shafayeatsumit
Last active September 10, 2020 22:55
Show Gist options
  • Save shafayeatsumit/4788de8d9b97f6622a894f08671f0422 to your computer and use it in GitHub Desktop.
Save shafayeatsumit/4788de8d9b97f6622a894f08671f0422 to your computer and use it in GitHub Desktop.
Adding custom fonts in react native 60+
```
make a folder in root app as : assets then fonts fonts folder in assets and put ttf fonts
make a file in root : react-native-config.js and add:
module.exports = {
project: {
android: {}
},
assets: ['./assets/fonts/'],
};
for ios:
copy font file ios/MyProjectName.xcodeproj/project.pbxproj
Go to:
"Build Phases" -> "Copy Bundle Resources" -> "+" -> "#select your font from assets/fonts folder"
add it in your iOS Info.plist:
<key>UIAppFonts</key>
<array>
<string>Your-Font-File-Name.ttf</string>
</array>
for Android:
copy font files to /android/app/src/main/assets/fonts
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment