zsft
v2.1.3
Published
Web font conversion, subsetting, and splitting
Maintainers
Readme
ZSFT CLI
ZSFT CLI is the command-line tool used by ZSFT, allowing you to subset, convert, and split font files through quick and simple commands, optimized for the Web.
Leveraging @web-alchemy/fonttools — a Node.js adapter for fonttools — and cn-font-split, ZSFT CLI delivers unparalleled compatibility and performance, with flawless support for TTF, OTF, WOFF, and WOFF2.
🎈 Installation
npm install -g zsft📝 Configuration
Create a config.json in the node_modules/zsft/ directory of the npm global module installation directory to configure the default behavior of zsft.
You can execute npm root -g to get the location of the global modules installation directory.
When reinstalling or updating the ZSFT CLI, the original
config.jsonfile will be overwritten, so please remember to keep a backup.
✨ Basic commands
Help
zsft -hzsft split -hConversion
Using the default behavior: read from ./main.ttf and output to ./main.woff2
zsftSpecify input and output
zsft ./myfont.ttf ./myfont.woffSpecify input only: automatically convert to .woff2, and the output name will be the same as the input name.
zsft ./myfont.ttfSubset
Using the default behavior: read from ./main.ttf and output to ./main.woff2
zsft --text "Hello World"Specify input and output
zsft ./main.ttf ./main.woff2 --text "Hello World"Directly use the defaultSubset or default characters in config.json
zsft -mSpecify input only: automatically convert to .woff2, and the output name will be the same as the input name.
zsft -m ./myfont.ttfSplit
Split a complete TTF or OTF font into multiple WOFF2 and CSS files for on-demand loading on the web.
zsft split ./myfont.ttfThis will output to the myfont/ directory.
📑 Complete document
📜 License
MIT © ZeoSeven
