網上比應用比較多的 字蛛 http://font-spider.org/python
本文使用了本機安裝軟件,獲得瘦身後的 TTF 字體文件linux
準備工具: git
python ; 我使用是 python-3.7.2.exe github
jre; 我是用的是 jre-8u191-windows-x64.exewindows
FontPruner; https://gulu-dev.com/post/2017/2017-09-15-font-pruner-intro/contentide
個人使用環境:win 7 64虛擬機工具
step1:安裝 python,jre post
setp2:從做者github 下載文件包。字體
window平臺使用須要修改一下做者的代碼(window下有一個錯誤,linux無).net
記事本打開
紅色箭頭加2括號便可
setp3:自定義要保留的文字
找到src/FontExtract/unChineseOutPut.txt 在這記事本內填入你要保留的文字 保存
step4:準備咱們處理的字體
我這裏爲了方便直接將ttf 字體拷貝到 同級目錄
step5: cmd 進入 所在目錄,使用命令 FontPruner.py --inputPath=./ --inputFont=./字體名.TTF --tempPath=./
step6:處理完會在同級目錄生成一個output 目錄 ,我們的目標字體文件就在裏面。
這裏還要感謝下 yeqiang https://blog.csdn.net/hknaruto 同窗 ;)