Loading fonts with next/font package
To load fonts with the next/font package, create the following folder structure (the example with GreycliffCF custom font):
In GreycliffCF.ts
file, add the following code:
Then add the font to your theme:
Loading fonts without next/font package
Create the following folder structure (the example with GreycliffCF custom font):
In GreycliffCF.css
file, add the following code:
Then import GreycliffCF.css
file at the root of your application and
add the font to your theme:
Load fonts from Google Fonts
Selects fonts you want to use at Google Fonts and copy HTML code snippet. For example, to load Roboto font, the code you receive from Google Fonts will look something like this:
Add the code to the head of your application and add the font to your theme:
Alternatively, you can download fonts from Google Fonts and load them with next/font package to have Next.js fonts optimization feature.