Adding font does not work


#1

I added a specific font I added to assets, tried to use it on css, didn’t work tho it should be.
I added it as a file on the directory through the console and it still didn’t show up on the website.
What did I do wrong?

@font-face {
    font-family: "8bitoperator_jve";
    src: url("/8bitoperator_jve.ttf");// I also tried url("https://cdn.glitch.com/379b2c22-f66d-4d71-8ed9-991dfdf8ad11%2F8bitoperator_jve.ttf");
}

In case something is wrong in this, please tell.


#2

It should work, it’s likely the path to your font is incorrect. Which folder are you referencing it from and how does that relate to the folder the font is in?


#3

from this page i tried what he did to add it to the directory: Upload script file -> reconnect
and then when i write ls in the console like he said it shows:
8bitoperator_jve.ttf index.html public README.md script.js styles.css views
and that means it’s there (the ttf file)


#4

Yes, it’s on the server, but it looks like it is in the root directory whereas it will likely need to be in the ‘views’ directory (depending on your setup). Try ‘mv /app/8bitoperator_jve.ttf /app/views/8bitoperator_jve.ttf’ from the console.


#5

i changed it and it went to this directory, i added /views/ in css as well but it still didn’t work


#6

I just noticed you’d previously tried the cdn link. That should have worked, so it’s likely the problem is elsewhere in how your css is being applied. Can you share the link to your project source code, so we can take a better look?


#7

https://glitch.com/edit/#!/undermake?path=styles.css:3:15 here’s the css link


#8

Your current setup is working for me!


#9

@Gareth it is? so why doesn’t it work for me :thinking:


#10

Which browser version are you using? Try viewing in an incognito window too in case something is getting cached.


#11

wow you’re right, it did work when i tried a different browser, i’ll try to update my current version of chrome if it needs one, and also i’ll check how to make sure it will work, thank you so much!