antfu / chinese-font-subset-for-crowds

Chinese font subset generator for Crowds

Home Page:https://github.com/ncase/crowds

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chinese font subset generator for Crowds

This repo is for solving the problem of large size of Chinese font, which is dissused at here(in Chinese).

The basic technique is to extract all the Chinese characters appears in zh-CN.html file, and make a subset font for them only. This can reduce the font size effectively.

Downside: This font become less flexible since it's only have font for the appeared characters. And you many need to generate the font again once you changed the text of zh-CN.html file

Usage

Requirement

  • Python 3+
  1. Update the submodule crowds
  2. Edit the config.py file
  3. Install fontstool library
pip install -r pip-requirement.txt
python ./generate_subset.py

Commit the crowds and push. It's all you have to do! 🎉

About

Chinese font subset generator for Crowds

https://github.com/ncase/crowds


Languages

Language:Python 96.3%Language:Batchfile 2.8%Language:Shell 0.9%