Wieldy
Search…
Fonts
Setting up a font for your project
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 Theme below.

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:
1
@font-face {
2
font-family: 'Normal';
3
src: url('Fonts/Normal-ExtraLight.eot');
4
src: url('Fonts/Normal-ExtraLight.eot?#iefix') format('embedded-opentype'),
5
url('Fonts/Normal-ExtraLight.woff2') format('woff2'),
6
url('Fonts/Normal-ExtraLight.woff') format('woff'),
7
url('Fonts/Normal-ExtraLight.ttf') format('truetype'),
8
url('Fonts/Normal-ExtraLight.svg#Normal-ExtraLight') format('svg');
9
font-weight: 200;
10
font-style: normal;
11
}
12
13
@font-face {
14
font-family: 'Normal';
15
src: url('Fonts/Normal-Light.eot');
16
src: url('Fonts/Normal-Light.eot?#iefix') format('embedded-opentype'),
17
url('Fonts/Normal-Light.woff2') format('woff2'),
18
url('Fonts/Normal-Light.woff') format('woff'),
19
url('Fonts/Normal-Light.ttf') format('truetype'),
20
url('Fonts/Normal-Light.svg#Normal-Light') format('svg');
21
font-weight: 300;
22
font-style: normal;
23
}
24
25
@font-face {
26
font-family: 'Normal';
27
src: url('Fonts/Normal-Regular.eot');
28
src: url('Fonts/Normal-Regular.eot?#iefix') format('embedded-opentype'),
29
url('Fonts/Normal-Regular.woff2') format('woff2'),
30
url('Fonts/Normal-Regular.woff') format('woff'),
31
url('Fonts/Normal-Regular.ttf') format('truetype'),
32
url('Fonts/Normal-Regular.svg#Normal-Regular') format('svg');
33
font-weight: normal;
34
font-style: normal;
35
}
36
37
@font-face {
38
font-family: 'Normal';
39
src: url('Fonts/Normal-Bold.eot');
40
src: url('Fonts/Normal-Bold.eot?#iefix') format('embedded-opentype'),
41
url('Fonts/Normal-Bold.woff2') format('woff2'),
42
url('Fonts/Normal-Bold.woff') format('woff'),
43
url('Fonts/Normal-Bold.ttf') format('truetype'),
44
url('Fonts/Normal-Bold.svg#Normal-Bold') format('svg');
45
font-weight: bold;
46
font-style: normal;
47
}
48
49
@font-face {
50
font-family: 'Normal';
51
src: url('Fonts/Normal-ExtraBold.eot');
52
src: url('Fonts/Normal-ExtraBold.eot?#iefix') format('embedded-opentype'),
53
url('Fonts/Normal-ExtraBold.woff2') format('woff2'),
54
url('Fonts/Normal-ExtraBold.woff') format('woff'),
55
url('Fonts/Normal-ExtraBold.ttf') format('truetype'),
56
url('Fonts/Normal-ExtraBold.svg#Normal-ExtraBold') format('svg');
57
font-weight: 800;
58
font-style: normal;
59
}
Copied!
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 Theme below.

Change Font Family in Theme

In this step, you could change the font-family in the file given below:
1
src / styles / global / varriables.less
Copied!
Now change update the font family like below:
1
@font-family: 'NoirPro', sans-serif;
2
3
// or
4
5
@font-family: 'Roboto', sans-serif;
Copied!
Last modified 7mo ago