#Woff font not loading
33 messages · Page 1 of 1 (latest)
It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.
Hi there! A bit of a late response so perhaps you’ve already solved this!
You can read about how to define custom fonts here: https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src#font_formats
The value for format() should be: format(“woff”)
i havent so thanks for the link i'm gonna try to see if it works
i had tried to do that but it still does not work sadly
i did try again but still doesnt work
as u can see in screens i use my font like that
but yet he doesnt want to load the font, all others font is working tho
Hi
Are you sure your font is valid? You should also put your font name in quotes in your css variable.
You say the other fonts work but they come from a URL, maybe your path to your woff fonts is not good
i used the right click copy relative path and paste it in the font.css
For the font where i downloaded it, i took it from the "network" page in the "inspector" on a website
and it downloaded the 3 variants, roman light and regular
i also have a font that is directly in my files thats works really well (graphik)
To second @surreal finch, you need to wrap your font names in quotation marks where you’re defining them in your vars.css file.
Just did that and does not work too :/
Does it work with css directly, without using the variable?
nop does not work too
i put font-family: 'deltra neue', sans-serif; and it appear to not be working
You must respect the case of your @font-face
'Delta Neue'
Have you tried it in another simple project with html/css only?
No i didnt tried in another simple project, only tried on this astro project, will give it a shot
When you say "respect the case of your @font-face"
you mean importing the font directly in the file i use it?
Are you french ?
yes
On va continuer en français alors
Essai dans dans un projet minimalist comme je t'ai dit, si ca fonctionne pas on saura déjà que ca vient pas de Astro
Et quand je disais la "case" c'est les majuscules
ah ok merci, je finis une tâche que j'ai à faire et je fais ça dans 5-10min, je te montrerais les screens au cas-où si je fais des erreurs de syntaxe
je viens de tester avec un code généré par chat gpt pour aller plus vite, et je pense avoir trouvé mon erreur
c'est une font Arial, sans serif, je vais tester dans astro voir si c'est ça le soucis
l'éditeur de droite le code fonctionne mais pas celui de gauche, cependant l'éditeur de droite utilise les fonts séparément, mais l'éditeur de gauche j'ai essayé de regrouper les 3 fonts dans une famille pour juste à voir à changer le font-weight pour passer de "Light à Roman ou Medium".
Le problème serait dans le nommage de la famille donc j'ai modifié comme sur le screen de droite en n'utilisant pas la variable mais directement mais ça ne fonctionne pas non plus (2eme screen)
Ps: j'ai oublié de préciser mais j'ai bel et bien modifier le nom des familles dans le screen de gauche avant de faire la manip du screen de droite
J'ai trouvé l'erreur! @surreal finch
Les fonts css sont sensibles à la casse et elles n'aiment pas les espaces dans les noms de familles!
J'ai donc tout modifié fais tout les tests possible et la solution est un simple tiret 🥲 pardon pour le dérangement
Tu fais un petit recap en anglais pour la commu stp 🙏
yep je fais un petit pavé pour eux merci pour totue ton aide
SOLUTION
So it appears that it is a css issue related to the naming of the family as per this screen right here
When you name a family, CSS does not like the fact that you put space, it is important to fill the gap with a "-" "_" or use the CamelCaseMethod to name your font-family
It was simple yet hard to find at first!