Adding custom fonts in React Native 0.60+ | React native | Android

preview_player
Показать описание
1. Get the font files needed for the project

The font files should be .ttf format. The font files can be obtained from Google fonts. Create a folder named fonts under the assets directory and place the font files in it.

2. Create a configuration file


project: {
ios:{},
android:{}
},
assets:['./assets/fonts/'],
}

3. Link the font assets
Link the newly added asset by running the following command:

npx react-native link
Рекомендации по теме
Комментарии
Автор

cool tutorial, do you know how to subset fonts?

iliyalyan
welcome to shbcf.ru