Home» Forum» Web & Tech» Custom fonts on neocities

Custom fonts on neocities

Back to Web & Tech

I've been trying to add a custom font to my neocities website for a while now but just cannot seem to figure it out. I was following a reddit tutorial most recently but just could not do it. Any tips?

Generally the process for adding a font is to:


- Upload the font to your website (it's a WOFF file or something)

- Use CSS to add a font-face

- Use CSS to set the font-family


Here's the example from MDN: @font-face CSS at-rule

@font-face {
  font-family: "Bitstream Vera Serif Bold";
  src: url("https://mdn.github.io/shared-assets/fonts/FiraSans-Regular.woff2");
}

body {
  font-family: "Bitstream Vera Serif Bold", serif;
}

@Jookia one thing to consider when setting custom fonts ofc

@font-face {
  src: url("link2font.woff2") format('woff2');
}

setting a format declaration rule in the @font-face css rules helps to speed up rendering  

and also forces the browser to not download a whole font just to check metadata stuff 

:star:




You must be logged in to reply.