gfont
一个字体处理方法合集,含有以下方法
- to_xml:将字体文件转换为 xml
- to_img:将单个或所有字体转为 Image 对象
- to_ocr:将单个或所有字体识别转为 str、dict 对象
- get_glyph_order:获取字段信息列表
- get_best_cmap:获取十六进制与字段信息字典
安装
pip install gfont
使用环境
pip install font2img==2.2
pip install fonttools==4.29.1
pip install Pillow==9.3.0
pip install paddlepaddle==2.3.2 -i https://mirror.baidu.com/pypi/simple
pip install "paddleocr==2.6.0.1"
示例
from gfont import FontHelper
f = FontHelper(path=r'font.ttf')
print(f.to_ocr())
Metadata
Release files for gfont 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gfont-0.0.3.tar.gz | 3.7 kB | Details |
Release files / gfont-0.0.3.tar.gz
| Download URL | gfont-0.0.3.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
504e5393cbc1a67b9f86908d826c3badeb75f875ce5d1c3dc9f4650d76f01f98
|
|
BLAKE2b-256 checksum How to use checksums |
37beae85075c9115dbc8b29dbcfc92541fa6056b4645c23b4f38fd76179a2ea0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.2
|