Open Source Developer Tool

FontCache

Google Fonts, without Google

Download and manage Google Fonts locally for improved performance, privacy, and reliability in your web projects.

npm install --save-dev fontcache

Why FontCache?

Take control of your web fonts with these powerful features

Offline Availability
Fonts are served locally, ensuring your site works perfectly even without an internet connection.
Improved Performance
Eliminate external requests and reduce loading times with locally cached font files.
Increased Privacy
No data sent to Google servers. Keep your users' browsing habits private.
Customization
Fine-tune font subsets, weights, and styles to match your exact requirements.
Font Consistency
Ensure consistent font rendering across all environments and browsers.
Easy Integration
Simple configuration and seamless integration with your existing build process.

Simple Configuration

Get started with just a few lines of configuration

fonts.config.json
{
  "fonts": [
    {
      "family": "Inter",
      "weights": ["400", "500", "600", "700"],
      "subsets": ["latin"],
      "display": "swap"
    },
    {
      "family": "JetBrains Mono",
      "weights": ["400", "500"],
      "subsets": ["latin"],
      "display": "swap"
    }
  ],
  "outputDir": "public/fonts"
}
styles.css
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') 
       format('woff2');
}

.font-inter {
  font-family: 'Inter', sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

Getting Started

Follow these simple steps to integrate FontCache into your project

1. Installation
Install FontCache as a development dependency
npm install --save-dev fontcache

Organized Font Structure

FontCache creates a clean, organized folder structure for your fonts

public/
fonts/
fontcache.css
inter-400.woff2
inter-600.woff2
jetbrains-mono-400.woff2

Open Source & Community

Contributing

FontCache is open source and welcomes contributions from the community. Help us improve the tool for everyone.

View on GitHub
License

FontCache is released under the MIT License. Free to use in personal and commercial projects.

MIT License