How to use fonts from local folder?

For some reason I can't figure this out. First one works, but I can't make "Regular" one work... I put "font-family:'SpartanRegular', sans-serif;" on element I want to have that font on, but nothing.
14 Replies
13eck
13eck•2y ago
Try adding ./ in front of the URLs: url('./spartan-cufonfonts/Spartan-Bold.ttf') That indicates a relative URL instead of an absolute URL
Dovah
DovahOP•2y ago
Folder with fonts is next to css file so /spartan-cufonfonts should work?
13eck
13eck•2y ago
./
Dovah
DovahOP•2y ago
Did it but nothing
13eck
13eck•2y ago
Dot-slash, not just slash
Dovah
DovahOP•2y ago
@cvanilla13eck Still nothing 😦 even with ./
13eck
13eck•2y ago
Damn
13eck
13eck•2y ago
I’m not that familiar with how to use font-face. Let’s ask Kevin: https://youtu.be/zK-yy6C2Nck
Kevin Powell
YouTube
Self-hosting fonts explained (including Google fonts) // @font-face...
Google fonts are great, but often self-hosting them is a better choice, or if you’re in parts of Europe, it might be your only choice, so in this video I take a look at the basics of how to self-host fonts. 🔗 Links ✅ Font Squirrel Webfont Generator: https://www.fontsquirrel.com/tools/webfont-generator ⌚ Timestamps 00:00 - Introduction 01:05 -...
Dovah
DovahOP•2y ago
Ohhh he has one nice Will check it out! Thanks
13eck
13eck•2y ago
There’s also this one: https://youtu.be/KzqQXDbDvus
Kevin Powell
YouTube
How to host your own fonts made simple
The first 1000 people to use the link will get a free trial of Skillshare Premium Membership: https://skl.sh/kevinpowell01211 Hosting your own fonts is a good way to improve the performance of your site, and in this video we look at how to do it with @font-face including where you can find fonts from, and how to set them up to make your life a...
Mannix
Mannix•2y ago
since one is working and other doesn't the path can't be wrong can it ?
13eck
13eck•2y ago
Get your logic outta here, x13ladMyDude !
WebMechanic
WebMechanic•2y ago
nope. URLs in CSS are relative to the .css file, either use ./spartan.woff or just spartan.woff Anything that starth with a / is an absolute URL that has its origin in the document root (project folder).
Want results from more Discord servers?
Add your server