Last active
September 10, 2020 22:55
-
-
Save shafayeatsumit/4788de8d9b97f6622a894f08671f0422 to your computer and use it in GitHub Desktop.
Adding custom fonts in react native 60+
This file contains 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
``` | |
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