Last active
December 18, 2020 13:31
-
-
Save franjohn21/f9aea7961275a093b93f19e1ea82fc72 to your computer and use it in GitHub Desktop.
Most performance font subsetting options via `pyftsubset`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For definition of each option: https://github.com/fonttools/fonttools/blob/master/Lib/fontTools/subset/__init__.py#L39 | |
pyftsubset path/to/existing/font.otf \ | |
--unicodes-file=path/to/unicode/file.txt \ | |
--flavor=woff2 \ | |
--layout-features='' \ | |
--no-hinting \ | |
--desubroutinize \ | |
--name-IDs='' \ | |
--drop-tables+=GSUB \ | |
--with-zopfli |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You probably have realised this, but take heed that these settings severely cripple the font. All OpenType layout features are dropped, including kerning (!), and hinting will be completely stripped. Also the name table is removed, which is probably against even open font licenses, and at the very least bad form. (It's like stripping the author name from open source JavaScript libraries)
It's a fun exercise in trying to get a small font file, but the sacrifice in legibility makes this very unsuitable for production, especially since you'll be talking about just a few kilobytes.