Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

expo font install

npx expo install expo-font
Comment

expo font

// How to add custom fonts to react native expo project
// 1 put your font.ttf file in: yourProjectFolder/assets/fonts/FontFile.ttf

// 2 Add this import
import { useFonts } from 'expo-font';

// 3 Add this hook to your component:
    const [loaded] = useFonts({   // make sure path is correct
        MyFontName: require('../assets/fonts/FontFile.ttf'),
    });   

// 4 then use it in your style sheet like this:
const styles = StyleSheet.create({
    myText:{
        fontFamily: 'MyFontName',
    },
});
// hope it helped :)

// IF THIS DOESNT WORK, TRY THIS
// 1 create "react-native.config.js" file in your project folder
// 2 copy this code to the file:
module.exports = {
    assets: ['./assets/fonts'],
};
// 3 open new terminal, and run (React >= 0.6.9):
npx react-native-asset
// or for older react-native versions: 
npx react-native link
// 4 now restart your expo app and it should work
Comment

PREVIOUS NEXT
Code Example
Shell :: fetch all git branches 
Shell :: symfony install doctrine 
Shell :: installing preload in ubuntu 
Shell :: remove cuda windows cmd 
Shell :: git merge vs git merge --no-ff 
Shell :: ubuntu visual studio path 
Shell :: how to uninstall program on ubuntu 
Shell :: how to get list of files in a folder in batch script 
Shell :: localhost wsl 
Shell :: minimize on click in ubuntu dock 
Shell :: install nvm mac with brew 
Shell :: grep ignore binary file 
Shell :: gitlab new project push commands 
Shell :: how to remove dpkg package in ubuntu 
Shell :: change regolith terminal 
Shell :: open git gui from command line 
Shell :: how to check size of image in linux 
Shell :: linux mail delete all 
Shell :: install nodejs debian 10 
Shell :: homebrew install sass 
Shell :: ubuntu permission all file in folder 
Shell :: git delete remote name 
Shell :: download code from github 
Shell :: install brave browser in ubuntu 
Shell :: pip problem linux 
Shell :: teamviewer raspberry pi command line 
Shell :: scp upload 
Shell :: list enviroment variables 
Shell :: aws cli s3 list buckets 
Shell :: composer remove packages 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =