Handright
Handright copied to clipboard
A lightweight Python library for simulating Chinese handwriting
我做了个 GUI
https://gitee.com/haujet/QuickHand https://github.com/HaujetZhao/QuickHand 通知下作者。或许可以给这个 GUI加个友链指向。
Considering this project is aiming to simulate Chinese Characters, so this issue report is writing in Chinese. 写字机一般是使用gcode来描述刀头(笔)的运动的方向的。gcode是一连串的向量组成的文件,也就是模拟了人手在写字时的笔尖的移动。 Handright模拟出来的手写笔记非常非常的真实,而将这些模拟的图片使用写字机还原到纸上却有比较大的问题: - 由于使用PIL输出图片,只能够将图片转换成gcode向量文件,可由于汉字的笔画是有厚度的,导致了直接用现有的转换方式无法转换出最佳的路径。 潜在的解决方案: 1. 将Handright输出图片转换为模拟人手写的gcode向量格式(优化困难) 2. 使用已有的商业软件(炽写、奎享雕刻等)创建单线字字形的gcode向量文件,然后使用Handright将每一个笔顺的向量集合作为整体旋转平移(较为简单) 3. 使用含有笔划及其位置的字库创建单线字字形 P.S.商业软件的单线字解决方案很简单粗暴,直接读取人手写的路径创建专门的字库,但这种做法也破坏了人手写的随机性. P.S.2Handright对笔画的区分,受限于笔者代码水平,实在没看懂[doge]...
原理:在_draw_stroke中,对每一个笔画的颜色深度进行了随机 
请问下字体颜色只能是黑白么?其他颜色该怎么选啊
Bumps [pillow](https://github.com/python-pillow/Pillow) from 8.3.2 to 10.0.1. Release notes Sourced from pillow's releases. 10.0.1 https://pillow.readthedocs.io/en/stable/releasenotes/10.0.1.html Changes Updated libwebp to 1.3.2 #7395 [@radarhere] Updated zlib to 1.3 #7344 [@radarhere] 10.0.0 https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html Changes...
保存PDF到本地或者返回字节流功能 parameters: export_pdf: whether export pdf, save_to_file: whether save pdf or export bytes, file_path: save path
新增涂改算法
原理:先从输入文本中随机挑选一个字符(非end_chars)输出,然后在上面画一道斜线表示涂改,接着在旁边写下原来正确的字符 为了增加效果,目前设置是50%的概率进行涂改,同时为了迅速看反响如何,所以并没有将代码按原来的格式修改,如果反响不错,我就继续修改 
你的代码里,每一个stroke都会随机旋转和上下移动。 ```python def _rotate( center: Tuple[float, float], x: float, y: float, theta: float ) -> Tuple[float, float]: if theta == 0: return x, y new_x = ((x - center[0]) *...
在英文文本中存在一个问题,例如“you”这个词的书写。第一行只有字母“y”,占满了整行,而“ou”却被挤到了下一行,导致在某些情况下字母的显示不完整。英文字体的大小似乎超出了可用空间,从而影响了排版效果。 