In your project, you would want to setup your own selected font. This section is a step-by-step guide on how to setup your custom font to your project.
Before moving further, Lets talk about the ways you can setup font in your project:
There could be two ways you could setup fonts in your project:
Via online font resources like Google Fonts
Via your custom web-font kit
Here below, these two ways are going to be detailed one by one.
Via Online Font Resources (Google Fonts)
For this, you will need to visit Google Fonts and pick the font you want to setup in your project.
Choose a font which you want to use and then select font styles. When you select a font style a style link will generate in right side section to add in your project
You will need to copy the <link> tag. Just like this is highlighted in the picture below for reference:
After copying the link, you need to place this in the <head> section of your public/index.html file .
This is the first step completed successfully and you have font resources included in your project.
Now, the last thing you need to do is, changing the values of font family in your theme. For that, you will need to follow the steps explained in Change Font Family in Themebelow.
Via Custom Web-Font Kit
For this, first of all, you must have a web-font-kit folder having all web font files.
Then you need to copy that folder into src / assets / vendors / fonts / and make sure that you have a style.css file in your web-font kit folder which has all weights and font-family set as given in below example:
Now include the style.css file in src / assets / vendors / style.js file .
Now, the last thing you need to do is, changing the values of font family in your theme. For that, you will need to follow the steps explained in Change Font Family in Themebelow.
Change Font Family in Theme
In this step, you could change the font-family in the file given below:
src/styles/global/varriables.less
Now change update the font family like below:
@font-family: 'NoirPro', sans-serif;
// or
@font-family: 'Roboto', sans-serif;