Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

google-webfonts-helper

> 编程语言
Open source

A Hassle-Free Way to Self-Host Google Fonts. Get eot, ttf, svg, woff and woff2 files + CSS snippets

13.0K stars0 likes2 views
WebsiteGitHub

About

A Hassle-Free Way to Self-Host Google Fonts. Get eot, ttf, svg, woff and woff2 files + CSS snippets

google-webfonts-helper

A Hassle-Free Way to Self-Host Google Fonts

✅ https://gwfh.mranftl.com

Current Sponsors

Help me keep this service alive by sponsoring me. Thank you. ❤️

ToC

  • google-webfonts-helper
    • Current Sponsors
    • ToC
    • Give it a try: https://gwfh.mranftl.com
    • Running gwfh on your own server
    • Development
      • Quickstart
      • Production build
    • JSON API
      • GET /api/fonts
      • GET /api/fonts/[id]?subsets=latin,latin-ext
      • GET /api/fonts/[id]?download=zip&subsets=latin&formats=woff,woff2&variants=regular
    • History
    • License

Give it a try: https://gwfh.mranftl.com

This service might be handy if you want to host a specific Google font on your own server:

  • font style and charset customization
  • CSS snippets
  • .eot, .woff, .woff2, .svg, .ttf font file formats download (zipped).

Running gwfh on your own server

I provide prebuilt Docker images via GitHub Packages. You can use them as follows:

bash
# See https://developers.google.com/fonts/docs/developer_api for creating your own API-Key.

docker run -e GOOGLE_FONTS_API_KEY=<YOUR-API-KEY> -p 8080:8080 ghcr.io/majodev/google-webfonts-helper:<TAG>
# Express server listening on 8080, in production mode

Development

Quickstart

Do this to setup a development environment:

…

Production build

If you want to build and run your own production container locally:

bash
# Build the production docker container (final stage)
docker build . -t <your-image-tag>

# Run it (if you have previously started the development container, halt it!)
./docker-helper.sh --halt
docker run -e GOOGLE_FONTS_API_KEY=<YOUR-API-KEY> -p 8080:8080 <your-image-tag>
# Express server listening on 8080, in production mode

To mitigate security issues especially with the projects' deprecated dependencies, the final image is based on a minimal container image. It runs rootless and has no development dependencies.

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://gwfh.mranftl.com/api/fonts:

json
[{
  "id": "open-sans",
  "family": "Open Sans",
  "variants": ["300", "300italic", "regular", "italic", "600", "600italic", "700", "700italic", "800", "800italic"],
  "subsets": ["devanagari", "greek", "latin", "cyrillic-ext", "cyrillic", "greek-ext", "vietnamese", "latin-ext"],
  "category": "sans-serif",
  "version": "v10",
  "lastModified": "2014-10-17",
  "popularity": 1,
  "defSubset": "latin",
  "defVariant": "regular"
} [...]
]

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

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

…

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

Download a zipped 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://gwfh.mranftl.com/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!)

History

2025:

  • Switch to node:22 for the final image.
  • Adds support for linux/arm64 architecture (patches imagemin/optipng-bin)

2024:

  • Switch to node:20 for the final image.

2023:

  • Project upgraded to be compatible with Node.js v18+.
  • Automated prebuilt Docker images via GitHub Actions.
  • /server was fully refactored/modernized (async/await) and now compiles with TypeScript.
  • Switch to node:18 for the final image.
  • /client can still be considered very legacy Angular code.

2022:

This service was mostly on life-support, most of its code and dependencies can be considered deprecated. The current docker image wrapping [email protected] runs rootless and is hopefully enough to keep the bandits out. API attack surface should be minimal anyways.

2014:

This service was originally a prototype I've created to get familiar with Angular and Express. All magic by generator-angular-fullstack. See my note here.

Idea originally by Clemens Lang who created an awesome bash script to download Google fonts in all formats.

License

(c) Mario Ranftl MIT License

Google Fonts Open Source Font Attribution

Issues· 63 open

View all issuesOpen on GitHub
  • #193

    Variable Font Support

    Updated Sep 19, 2026
  • #32

    Base64 support

    enhancementUpdated Sep 19, 2026
  • #188

    Make CSS responsive

    Updated Oct 7, 2025
  • #184

    Noto Color Emoji: missing characters?

    Updated Sep 17, 2025
  • #192

    Missing SVGs for extended charsets

    Updated May 22, 2025
  • #191

    Copy snippet Button

    Updated May 13, 2025
  • #178

    Missing styles for Roboto Flex

    Updated Jan 1, 2025
  • #189

    Red Hat Display not rendered correctlyd

    Updated Oct 20, 2024
  • #187

    Searching for the Font "Play" causes everything to display

    Updated Jun 30, 2024
  • #186

    'Source Sans 3' Uses Incorrect Family Name

    Updated Jun 7, 2024

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言