1.0.0 • Published 5 years ago
react-native-font-global v1.0.0
react-native-font-global
React Native apply custom font for iOS and Android
Installation
Add font file to your app src/assets/fonts/
In react-native.config.js :
module.exports = { ... project: { ios: {}, android: {}, }, assets: ['./src/assets/fonts'], ... };Install package
using npm
npm install react-native-font-globalusing yarn
yarn add react-native-font-globalLink Fonts
react-native linkiOS
pod installAndroid (Auto-linking)
Usage
Go to your first component which wraps the whole application (mostly App.js).
import applyFontGlobally from 'react-native-font-global';
applyFontGlobally('YourCustomFontName');Example App
Example app can be found in example/ directory.
How to use and run example
Clone Repository
git clone https://github.com/ajaybhatia/react-native-font-globalSwtich to example directory
cd exampleInstall dependencies
npm installRun example
Android:
react-native run-androidiOS:
pod installreact-native run-ios
1.0.0
5 years ago