Web font conversion, subsetting, and splitting
bash
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.json file will be overwritten, so please remember to keep a backup.
✨ Basic commands
$3
`bash
zsft -h
`
`bash
zsft split -h
`
$3
Using the default behavior: read from ./main.ttf and output to ./main.woff2
`bash
zsft
`
Specify input and output
`bash
zsft ./myfont.ttf ./myfont.woff
`
Specify input only: automatically convert to .woff2, and the output name will be the same as the input name.
`bash
zsft ./myfont.ttf
`
$3
Using the default behavior: read from ./main.ttf and output to ./main.woff2
`bash
zsft --text "Hello World"
`
Specify input and output
`bash
zsft ./main.ttf ./main.woff2 --text "Hello World"
`
Directly use the defaultSubset or default characters in config.json
`bash
zsft -m
`
Specify input only: automatically convert to .woff2, and the output name will be the same as the input name.
`bash
zsft -m ./myfont.ttf
`
$3
Split a complete TTF or OTF font into multiple WOFF2 and CSS files for on-demand loading on the web.
`bash
zsft split ./myfont.ttf
`
This will output to the myfont/` directory.