Note: If you encounter some errors after upgrade, clean cache files described at the end of the page.
- Linux
- MacOS
By default, gfont doesn't need google font API key, instead it uses generated data/webfonts.json. This generated file won't be refreshed very often and contains older fonts. If you want more up-to-date fonts, add 'GOOGLE_FONTS_API_KEY' environment variable inside ~/.bashrc or ~/.profile.
See Google Fonts Developer API to generate your API key.
Note: For linux, pipx is recommended instead of pip
pip install "git+https://github.com/nureon22/gfont.git"
pipx install "git+https://github.com/nureon22/gfont.git"
For ArchLinux gfont package is available in AUR
- python 3.8 or newer
- python-venv
- git
- requests
- hatch (development)
All commands support case-insensitive family names.
You can also use underscore (_) or dash (-) or plus (+) instead of space character in family name.
Search available families
gfont search noto sans
Install one or more families
gfont install noto-sans
Remove one or more families
gfont remove noto-sans
View overview information of the family
gfont info noto-sans
List installed families
gfont list
Update installed families to latest version
gfont update
Pack woff2 fonts and it's css to be used as self-hosted fonts in websites.
Don't forget to use single or double quotes for safety.
gfont webfont "noto-sans" --dir <dir>
gfont webfont "noto-sans:ital,wght@0,400;0,700" --dir <dir>
gfont webfont "open-sans:ital,wght@0,300..700" --dir <dir>
Install search results
gfont install $(gfont search noto sans | sed 's/ /_/g')
gfont <command> --help
Directory for cached metadata of families
Linux: ~/.cache/gfont
Mac: ~/Library/Caches/gfont
Directory for installed fonts
Linux: ~/.local/share/fonts/gfont
Mac: ~/Library/Fonts/gfont