Skip to main content

一个模拟中文手写的轻量级Python库

项目描述

右手

一个模拟中文手写的轻量级Python库

发布版本 蟒蛇版本 执照

在 Linux 上测试 在 Windows 上测试 在 MacOS 上测试

教程| 发行说明| 贡献

想象

揭示中文手写的本质,并用它来实现美观、简单和易于使用的界面。

算法

首先,在水平位置、竖直位置和字体大小自由度上,对每个字的整体做散播活动。的每个笔画做经常打扰动。

安装

pip install handright

快速开始

# coding: utf-8
from PIL import Image, ImageFont

from handright import Template, handwrite

text = "我能吞下玻璃而不伤身体。"
template = Template(
    background=Image.new(mode="1", size=(1024, 2048), color=1),
    font=ImageFont.truetype("path/to/my/font.ttf", size=100),
)
images = handwrite(text, template)
for im in images:
    assert isinstance(im, Image.Image)
    im.show()

更多信息请看教程

加入我们

扫码或点击链接加入Handright社区: 手右

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

handright-8.0.0.tar.gz (12.6 kB 查看哈希)

已上传 source

内置分布

handright-8.0.0-py3-none-any.whl (11.8 kB 查看哈希)

已上传 py3