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"- Download gfont.pyz from Release Page
- Give gfont.pyz executable permission.
chmod +x gfont.pyz - Copy gfont.pyz to your PATH and you're ready to go
Notes: To get the new version, you need to follow the steps above again if you're using this method.
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 sansInstall one or more families
gfont install noto-sansRemove one or more families
gfont remove noto-sansView overview information of the family
gfont info noto-sansList installed families
gfont listUpdate installed families to latest version
gfont updatePack 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