---
title: "Discussion on \"A Practical Guide to Self-Hosting Web Fonts\" | Hashnode"
description: "Discussion on \"A Practical Guide to Self-Hosting Web Fonts\". Build fast pages and reduce layout shift by following these web-font self-hosting best practices applied with CSS."
url: "https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [A Practical Guide to Self-Hosting Web Fonts](https://tristanguest.hashnode.dev/a-practical-guide-to-self-hosting-web-fonts?utm_source=hashnode&utm_medium=feed)

Build fast pages and reduce layout shift by following these web-font self-hosting best practices applied with CSS.

May 9, 2022 · 9 min read · tristanguest.hashnode.dev  
Updated Feb 14, 2023  
Read the article

-   [#fonts](https://hashnode.com/tag/fonts)
-   [#css](https://hashnode.com/tag/css)
-   [#nextjs](https://hashnode.com/tag/nextjs)

## Written by

[Tristan Guest](https://hashnode.com/@tbguest)

@tbguest · Nova Scotia, Canada

  
[View profile](https://hashnode.com/@tbguest)

Software Developer | Oceanographer

I am a full-stack software developer working on the Atlantic coast of Canada. I'm building tools to help visualize ocean data with JavaScript and React.

## Responses 7

Markdown supported · ⌘↵ to post

[Bruce Wells](https://hashnode.com/@PHPFUI)

[May 20, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/62879be28fb776481a28555c)

Great article. Thanks for sharing this knowledge. It is so important to give back, it just makes everything so much better. I never knew fonts were so involved.

[Lauchlan Chisholm](https://hashnode.com/@lauchness)

[May 16, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/62827b3883e2720b553c5306)

What a well written, and thorough post.

So great to see such a rarely-seen level of effort!

Nice work!

[Cess](https://hashnode.com/@Cesscode)

[May 13, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627ee66c55afbae29a623896)

Interesting article

[Andrew Baisden](https://hashnode.com/@andrewbaisden)

[May 13, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627e8c2a01c71be2bfdffa09)

Interesting article this would be a good alternative. So used to just using google fonts.

[Victor Eke](https://hashnode.com/@Eke)

[May 13, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627e84a701c71be2bfdff8c9)

Thanks for writing this amazing article [Tristan Guest](https://hashnode.com/@tbguest). I do have a few questions though. How will one specify different weights for a font downloaded from googlefonts?

Let's say I download the Inter font with different weights: 300, 400, and 600, and add them to a `font` folder. How will these weights be included in the `@font-face` property?

[Tristan Guest](https://hashnode.com/@tbguest)

[May 14, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627e84a701c71be2bfdff8c9#reply-627fa5a00094f2f13f5142fc)

Hi [Victor Eke](https://hashnode.com/@Eke) , I'd achieve this with multiple `@font-face` declarations. `font-weight` does accept two arguments (specifying a range), but that only applies if the `src` field URL points to a variable font file.

As far as I know, there's no way around needing a separate `@font-face` declaration for each hosted font file. Something like:

```
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  src: local(""), url("/fonts/inter-v11-latin-regular.woff2") format("woff2"),
    url("/fonts/inter-v11-latin-regular.woff") format("woff");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  src: local(""), url("/fonts/inter-v11-latin-900.woff2") format("woff2"),
    url("/fonts/inter-v11-latin-900.woff") format("woff");
}
```

[Victor Eke](https://hashnode.com/@Eke)

[May 15, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627e84a701c71be2bfdff8c9#reply-628115a6bc9305ec393653a5)

Wow, I never knew this. Thank you so much. 🎉 [Tristan Guest](https://hashnode.com/@tbguest)

[TomTom Developers](https://hashnode.com/@tomtomdevs)

[May 13, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627dc5df2621acd3b1ff2c9c)

Great article! Loved the read and information!

[Tristan Guest](https://hashnode.com/@tbguest)

[May 13, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627dc5df2621acd3b1ff2c9c#reply-627e5e5455afbae29a6227cb)

Thank you! I'm glad you enjoyed it.

[Randy Knight](https://hashnode.com/@RandyKnight)

[May 12, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627d6375168c80d47f461804)

Thanks for this incredibly informative article. 😎 It's amazing how complicated web fonts can be. This material is a must-know for people in website development.

[Tristan Guest](https://hashnode.com/@tbguest)

[May 13, 2022](https://hashnode.com/posts/a-practical-guide-to-self-hosting-web-fonts/62799979076291997b765e24/comment/627d6375168c80d47f461804#reply-627e5dd355afbae29a6227c1)

Agreed! You're very welcome.
