_____ _ ____ _ _ _
| ___|__ _ __ | |_ / ___| _ __ | (_) |_
| |_ / _ \| '_ \| __| \___ \| '_ \| | | __|
| _| (_) | | | | |_ ___) | |_) | | | |_
|_| \___/|_| |_|\__| |____/| .__/|_|_|\__|
|_|
Subset a single font file according to the provided Unicode Range
- Analyze the css file from remote(local will support later)
- Subset the font file according to the css file
- Compress the font file to woff2 format
- Generate the css file with the subsetted font file(cusomized url will support later)
fonttools(Python)
npm install -g font-split
Do NOT specify the template that with more than 1 font-weight.
This tool only tests on Google fonts.
example:
font-split --font "./font.otf" --family "SourceHans" --weight 400 --template "https://fonts.googleapis.com/css2?family=Noto+Sans+SC&display=swap"
- Support local css file
- merge Unicode Range
- Read config from file
- Remove duplicate Unicode Range
- Optimize user interaction
- cusomized url
- Env check
- Merge css file
- ...
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please follow the AngularJS Git Commit Message Conventions