Your web font utility belt. It can subset web fonts. It can show you what unicode-ranges are used on a web site (optionally per font-family). It can also subset web fonts automatically using the unicode-ranges it found. It makes julienne fries.
Available on npm.
npm install -g glyphhanger
See https://github.com/fonttools/fonttools.
pip install fonttools
# Additional installation for --flavor=woff2
git clone https://github.com/google/brotli
cd brotli
python setup.py install
# Additional installation for --flavor=woff --with-zopfli
git clone https://github.com/anthrotype/py-zopfli
cd py-zopfli
git submodule update --init --recursive
python setup.py install
If you want to read an in-depth tutorial on the installation steps above, please read How I set up Glyphhanger on macOS for optimizing and converting font files for the Web by Sara Soueidan.
Related: operate on existing unicode-range
values with Unicode Range Interchange (read the blog post).
# local file
glyphhanger ./test.html
glyphhanger ./test.txt
# output characters instead of Unicode code points
glyphhanger ./test.html --string
# remote URL
glyphhanger https://example.com
# multiple URLs, optionally using HTTPS
glyphhanger https://google.com https://www.zachleat.com
# show results for each font-family on the page
glyphhanger ./test.html --json
# show results only for one or more font-family names
glyphhanger ./test.html --family='Open Sans, Roboto'
# Show version
glyphhanger --version
# See more usage
glyphhanger --help
Replaces --verbose
in v3.0.0
.
> DEBUG=glyphhanger* glyphhanger https://example.com
Use --subset=*.ttf
to select some font files for subsetting. Note that you can also subset yourself manually with pyftsubset
(but glyphhanger is easier).
Note that the DEBUG
output documented above will log the specif