工具集用于处理TTF字体文件,包括预览生成、信息修改、字体合并等功能。
- Python 3.9+
- 克隆仓库:
git clone https://github.com/happyjake/font-tools.git
cd font-tools
- 创建虚拟环境:
python -m venv venv
source ./venv/bin/activate
- 安装依赖::
pip install -r requirements.txt
If you encounter an error while installing dependencies with pip, try installing libjpeg-turbo:
pkg in libjpeg-turbo
./脚本选择.sh
如果遇到以下错误 / If you encounter this error:
ImportError: cannot import name '_imagingft' from 'PIL' (/data/data/com.termux/files/home/font-tools/venv/lib/python3.12/site-packages/PIL/__init__.py)
解决方法 / Solution:
- 安装系统依赖 / Install system dependencies:
pkg install libjpeg-turbo freetype python-pillow
- 重置虚拟环境 / Reset virtual environment:
deactivate
source venv/bin/activate
- 重新安装Pillow / Reinstall Pillow:
pip uninstall Pillow
pip install --no-cache-dir Pillow