···2233[](https://www.npmjs.com/package/@intergrav/fonts) [](https://cdn.jsdelivr.net/npm/@intergrav/fonts/) [](https://github.com/intergrav/fonts)
4455-A fast, open-source CDN for open-source fonts. Inspired by [xz/fonts](https://github.com/xz/fonts).
55+A fast, open-source CDN for open-source fonts. You can view available fonts in the [`/serve`](https://github.com/intergrav/fonts/tree/main/serve) directory. More fonts will be added later. If you have any suggestions for general improvements or fonts, feel free to open an issue.
6677-You can view available fonts in the `/serve` directory. More fonts will be added later. If you have any suggestions, open up an issue.
77+Typically, web developers have two main methods for using custom fonts on their websites:
8899-Typically, web developers use custom fonts on their websites using one of two methods:
99+1. Hosting font files on the same server as the website. This method provides all control over font hosting, but it will usually result in slower loading times and increased server load, especially in some areas of the world.
1010+1111+2. Using a central font service, such as Google Fonts or Adobe Typekit. This method is very easy, but if the service ever experiences downtime or slowdowns, it can negatively impact the user experience.
1212+1313+In comparison, intergrav/fonts offers several advantages:
10141111-- hosting font files on the same server as the website
1212-- using a central font service, such as Google Fonts or Adobe Typekit
1515+- intergrav/fonts serves font files through jsDelivr's global content delivery network. jsDelivr uses [multiple CDNs](https://www.jsdelivr.com/network/infographic) for delivery, ensuring that fonts are delivered quickly and reliably regardless of user location.
13161414-intergrav/fonts, by comparison:
1717+- intergrav/fonts is fully open source, so anyone can contribute to its development and improvement. This includes requesting new fonts or making improvements to files. You can also fork it if you want to start your own project.
15181616-- serves font files through jsDelivr's global content delivery network
1717-- is fully open source and only serves open source fonts
1919+- intergrav/fonts exclusively serves open source fonts. By avoiding proprietary or licensed fonts, you can avoid any potential restrictions through licensing.
18201921## Importing
20222121-In your CSS you could do:
2323+To use the fonts provided by intergrav/fonts, you have to import the CSS file in your project. There are two ways to do this:
2424+2525+### CSS Import
2626+2727+In your CSS file, you can import the font CSS content using the `@import` rule:
22282329```css
2430@import url("https://cdn.jsdelivr.net/npm/@intergrav/fonts@1/serve/inter.min.css");
2531```
26322727-Or in your HTML's `<head>` you could do:
3333+### HTML Link
3434+3535+Alternatively, you can link the font CSS file directly in the `<head>` section of your HTML file:
28362937```html
3038<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/fonts@1/serve/inter.min.css">
3139```
32403333-Replace `inter` with the font name, of course.
4141+### Set a font
4242+4343+Remember to replace `inter` in the URL with the actual font name you want to use. Visit the [`/serve`](https://github.com/intergrav/fonts/tree/main/serve) directory for fonts that you can use. You can [open an issue](https://github.com/intergrav/fonts/issues) if you need a font to be added, but remember that this project only serves open-source fonts.
4444+4545+If you're curious, the `.min` in the link means to ask jsDelivr to minify the file using [clean-css](https://github.com/clean-css/clean-css). It often significantly decreases the file's size at no cost, so I recommend using it.
4646+4747+## Credits
4848+4949+- [xz/fonts](https://github.com/xz/fonts) is the main inspiration for this project