Skip to content

使用Python库fonttools完成转换,生成的文件仅有几Kb,与原文件的8M对比...

使用定制字体WOFF文件

安装Python

https://www.python.org/

安装fonttools

sh
 pip install fonttools

创建一个chars.txt文件写入需要定制的文字

使用命令

sh
pyftsubset 原字体.ttf --text-file=chars.txt --output-file=mini-font.woff

IMPORTANT

首先得有一个完整的字体文件才行

Google Fonts官网:https://fonts.google.com

最后更新时间: