snippetbashTip
fonttools subset — Generate subsets of fonts or optimize file sizes. More information: <https://fonttools.readthedocs.i
Viewed 0 times
fonttools subsetcommandfontsoptimizeclifilesubsetsgenerate
linux
Problem
How to use the
fonttools subset command: Generate subsets of fonts or optimize file sizes. More information: <https://fonttools.readthedocs.io/en/latest/subset/index.html>.Solution
fonttools subset — Generate subsets of fonts or optimize file sizes. More information: <https://fonttools.readthedocs.io/en/latest/subset/index.html>.Subset a TTF font file to the Basic Latin Unicode block:
fonttools subset {{path/to/font.ttf}} --unicodes=U+0000-007FChange the file type to WOFF2:
fonttools subset {{path/to/font.ttf}} --unicodes=U+0000-007F --flavor=woff2Keep only the onum (oldstyle figures) and kern (kerning) OpenType font features:
fonttools subset {{path/to/font.ttf}} --unicodes=U+0000-007F --layout-features=onum,kernSet the output file's name:
fonttools subset {{path/to/font.ttf}} --unicodes=U+0000-007F --output-file={{path/to/subset.ttf}}Code Snippets
Subset a TTF font file to the Basic Latin Unicode block
fonttools subset {{path/to/font.ttf}} --unicodes=U+0000-007FChange the file type to WOFF2
fonttools subset {{path/to/font.ttf}} --unicodes=U+0000-007F --flavor=woff2Keep only the onum (oldstyle figures) and kern (kerning) OpenType font features
fonttools subset {{path/to/font.ttf}} --unicodes=U+0000-007F --layout-features=onum,kernSet the output file's name
fonttools subset {{path/to/font.ttf}} --unicodes=U+0000-007F --output-file={{path/to/subset.ttf}}Context
tldr-pages: linux/fonttools subset
Revisions (0)
No revisions yet.