EuphoriaYan / zi2zi-pytorch

zi2zi implement with pytorch
192 stars 43 forks source link

训练完成之后,怎么作为新的字体导出? #26

Open jilieryuyi opened 2 years ago

jilieryuyi commented 2 years ago

如题,如何存储为新的ttf字体?

ShellWen commented 2 years ago

同问,几个月过去了..

889098 commented 2 years ago

好像并没有直接生成字体,只是生成了图片,需要再导入fontcreator、fontforge等软件制作字体

RongXueE commented 1 year ago

如题,如何存储为新的ttf字体?

同问,几个月过去了..

您好,我在跑这个代码的预处理阶段出现了以下的问题: python font2img.py --src_font=src.ttf --dst_font=trg.otf --charset=CN --sample_count=1000 --sample_dir=dir --label=0 --filter --shuffle --mode=font2font Traceback (most recent call last): File "font2img.py", line 340, in args.sample_count, args.sample_dir, args.label, args.filter) File "font2img.py", line 138, in font2font src_font = ImageFont.truetype(src, size=char_size) File "/root/miniconda3/lib/python3.7/site-packages/PIL/ImageFont.py", line 976, in truetype return freetype(font) File "/root/miniconda3/lib/python3.7/site-packages/PIL/ImageFont.py", line 973, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/root/miniconda3/lib/python3.7/site-packages/PIL/ImageFont.py", line 250, in init font, size, index, encoding, layout_engine=layout_engine OSError: cannot open resource

想问一下这个--src_font=src.ttf --dst_font=trg.otf这两个参数的设置需要修改吗?期待您的回复

zombieMaybeLikeCake commented 1 year ago

可能是--charset=CN出現問題 你必須創一個.txt檔裡面是dst_font有支援到的字 --charset=你創的.txt檔名