gfont


Namegfont JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/Leviathangk/gfont
Summary字体解析、ocr 工具
upload_time2022-12-01 01:02:52
maintainer
docs_urlNone
author郭一会儿
requires_python
licenseMIT Licence
keywords font font2img fonttools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Leviathangk/gfont",
    "name": "gfont",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "font,font2img,fonttools",
    "author": "\u90ed\u4e00\u4f1a\u513f",
    "author_email": "1015295213@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/37/be/ae85075c9115dbc8b29dbcfc92541fa6056b4645c23b4f38fd76179a2ea0/gfont-0.0.3.tar.gz",
    "platform": "any",
    "description": "# gfont\r\n\r\n\u4e00\u4e2a\u5b57\u4f53\u5904\u7406\u65b9\u6cd5\u5408\u96c6\uff0c\u542b\u6709\u4ee5\u4e0b\u65b9\u6cd5\r\n\r\n- to_xml\uff1a\u5c06\u5b57\u4f53\u6587\u4ef6\u8f6c\u6362\u4e3a xml\r\n- to_img\uff1a\u5c06\u5355\u4e2a\u6216\u6240\u6709\u5b57\u4f53\u8f6c\u4e3a Image \u5bf9\u8c61\r\n- to_ocr\uff1a\u5c06\u5355\u4e2a\u6216\u6240\u6709\u5b57\u4f53\u8bc6\u522b\u8f6c\u4e3a str\u3001dict \u5bf9\u8c61\r\n- get_glyph_order\uff1a\u83b7\u53d6\u5b57\u6bb5\u4fe1\u606f\u5217\u8868\r\n- get_best_cmap\uff1a\u83b7\u53d6\u5341\u516d\u8fdb\u5236\u4e0e\u5b57\u6bb5\u4fe1\u606f\u5b57\u5178\r\n\r\n# \u5b89\u88c5\r\n\r\n```\r\npip install gfont\r\n```\r\n\r\n# \u4f7f\u7528\u73af\u5883\r\n\r\n```\r\npip install font2img==2.2\r\npip install fonttools==4.29.1\r\npip install Pillow==9.3.0\r\npip install paddlepaddle==2.3.2 -i https://mirror.baidu.com/pypi/simple\r\npip install \"paddleocr==2.6.0.1\"\r\n```\r\n\r\n# \u793a\u4f8b\r\n\r\n```\r\nfrom gfont import FontHelper\r\n\r\nf = FontHelper(path=r'font.ttf')\r\nprint(f.to_ocr())\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT Licence",
    "summary": "\u5b57\u4f53\u89e3\u6790\u3001ocr \u5de5\u5177",
    "version": "0.0.3",
    "split_keywords": [
        "font",
        "font2img",
        "fonttools"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "b00cc1f2225c3fe23c27f23bec6ea542",
                "sha256": "504e5393cbc1a67b9f86908d826c3badeb75f875ce5d1c3dc9f4650d76f01f98"
            },
            "downloads": -1,
            "filename": "gfont-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b00cc1f2225c3fe23c27f23bec6ea542",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3739,
            "upload_time": "2022-12-01T01:02:52",
            "upload_time_iso_8601": "2022-12-01T01:02:52.483531Z",
            "url": "https://files.pythonhosted.org/packages/37/be/ae85075c9115dbc8b29dbcfc92541fa6056b4645c23b4f38fd76179a2ea0/gfont-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-01 01:02:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Leviathangk",
    "github_project": "gfont",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gfont"
}
        
Elapsed time: 0.01890s