How to add custom fonts in T3 app

is there a definitive way of doing this I've tried many ways but none of them work. I want to use poppins font from google fonts
16 Replies
barry
barry3y ago
I like the new @next/font thing Adds fonts easily
aditya
adityaOP3y ago
is it in next 13 or can i use it in my app
barry
barry3y ago
Go look it up It’s it’s own package
aditya
adityaOP3y ago
ah okay its in next13 ill have to setup layout.tsx is there any other way?
barry
barry3y ago
No you don’t I literally just did it myself, imported the font and used it
barry
barry3y ago
GitHub
GitHub - barrybtw/next13-hero
Contribute to barrybtw/next13-hero development by creating an account on GitHub.
cje
cje3y ago
next/font is cool if you're still on next 12, fontsource is fine
barry
barry3y ago
Why would it not work in v12 though
cje
cje3y ago
never mind i thought it was a new thing anyway managing and loading fonts has historically been kind of a pain if you want it to be great, and next/font seems like the best solution imo you should still spend some time learning about how webfonts work and the different things that can happen depending on the user's browser settings
aditya
adityaOP3y ago
thanks for reference in the documentation there was layout.tsx so i thought i have to make it
Leonidas
Leonidas3y ago
I recommend you to self host your fonts with linked stylesheets. Online you can find some code gen tools so you simply have to download and extract a zip to your public directory in next and import the css file in it
aditya
adityaOP3y ago
do i have to add _documents.tsx to use the fonts?
barry
barry3y ago
Just try 🤷 Check docs for next font
aditya
adityaOP3y ago
was going through your project really cool
Leonidas
Leonidas3y ago
google webfonts helper
A Hassle-Free Way to Self-Host Google Fonts. Get eot, ttf, svg, woff and woff2 files + CSS snippets!
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server