Skip to content

rathax/FontDownloader

Repository files navigation

Welcome to FontDownloader.org. This service might be useful if you want to host a specific Google font on your own server. It's a straightforward app where you can pick and choose the exact fonts you need for your projects to self-host.

Why Use Fontdownloader

  • Customize: Pick only the font subsets and variants you actually need.
  • Speed is Key: I’ve built this using Vue, Vuetify and Tailwind for a snappy experience in material design.
  • Boost Your Site’s Health: Self-host those fonts! It’s a game-changer for your Google PageSpeed and Lighthouse scores by avoiding unnecessary external requests.
  • Privacy-Focused: In a world where tracking is everywhere, hosting your fonts means one less way for big companies to monitor your users and reduces the surface of potential GDPR violations.

Roadmap

  • Improve Mobile UX
  • create favicon
  • Add FAQs
  • add translations
  • add e2e (playwright) test suit
  • Rewrite the backend with NestJS
  • ...

Feel free to open issues and provide feedback.

JSON API

The API is public, feel free to use it directly (rate-limits may apply).

GET /api/fonts

Returns a list of all fonts, sorted by popularity. E.g. curl https://fontdownloader.org/api/fonts:

[{
"id":"roboto",
"family":"Roboto",
"variants":["100","100italic","300","300italic","regular","italic","500","500italic","700","700italic","900","900italic"],
"subsets":["cyrillic","cyrillic-ext","greek","greek-ext","latin","latin-ext","vietnamese"],
"category":"sans-serif",
"version":"v30","lastModified":"2022-09-22","popularity":1,"defSubset":"latin","defVariant":"regular"
}
[...]
]

GET /api/fonts/[id]?subsets=latin,latin-ext

Returns a specific font with urls to the actual font files hosted on google's servers. subsets is optional (will serve the defSubset if unspecified). E.g. curl "https://fontdownloader.org/api/fonts/modern-antiqua?subsets=latin,latin-ext" (the double quotes are important as query parameters may else be stripped!):

{
  "id": "modern-antiqua",
  "family": "Modern Antiqua",
  "variants": [{
    "id": "regular",
    "eot": "https://fonts.gstatic.com/s/modernantiqua/v6/8qX_tr6Xzy4t9fvZDXPkhzThM-TJeMvVB0dIsYy4U7E.eot",
    "fontFamily": "'Modern Antiqua'",
    "fontStyle": "normal",
    "fontWeight": "400",
    "woff": "https://fonts.gstatic.com/s/modernantiqua/v6/8qX_tr6Xzy4t9fvZDXPkh1bbnkJREviNM815YSrb1io.woff",
    "local": ["Modern Antiqua Regular", "ModernAntiqua-Regular"],
    "ttf": "https://fonts.gstatic.com/s/modernantiqua/v6/8qX_tr6Xzy4t9fvZDXPkhxr_S_FdaWWVbb1LgBbjq4o.ttf",
    "svg": "https://fonts.gstatic.com/l/font?kit=8qX_tr6Xzy4t9fvZDXPkh0sAoW0rAsWAgyWthbXBUKs#ModernAntiqua",
    "woff2": "https://fonts.gstatic.com/s/modernantiqua/v6/8qX_tr6Xzy4t9fvZDXPkh08GHjg64nS_BBLu6wRo0k8.woff2"
  }],
  "subsets": ["latin", "latin-ext"],
  "category": "display",
  "version": "v6",
  "lastModified": "2014-08-28",
  "popularity": 522,
  "defSubset": "latin",
  "defVariant": "regular",
  "subsetMap": {
    "latin": true,
    "latin-ext": true
  },
  "storeID": "latin-ext_latin"
}

GET /api/fonts/[id]?download=zip&subsets=latin&formats=woff,woff2&variants=regular

Downloads an archive with all .eot, .woff, .woff2, .svg, .ttf files of a specified font. The query parameters formats and variants are optional (includes everything if no filtering is applied). is E.g. curl -o fontfiles.zip "https://fontdownloader.org/api/fonts/lato?download=zip&subsets=latin,latin-ext&variants=regular,700&formats=woff" (the double quotes are important as query parameters may else be stripped!)

Attributon

This app was written as a portfolio app with the help of AI tools (mostly texts from ChatGPT 4.0).

Initial app written by majodev

check out the original google-webfonts-helper repo where you can also find the backend and docker images

Project setup

# yarn
yarn

# npm
npm install

# pnpm
pnpm install

# bun
bun install

Compiles and hot-reloads for development

# yarn
yarn dev

# npm
npm run dev

# pnpm
pnpm dev

# bun
bun run dev

Compiles and minifies for production

# yarn
yarn build

# npm
npm run build

# pnpm
pnpm build

# bun
bun run build

Customize configuration

See Configuration Reference.

About

UI for using the google fonts api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages