Closed jichunshen closed 6 years ago
you can see the code: `
if font_name == "宋体":
font_name = "SIMSUN.ttc"
if font_name == "楷体":
font_name = "SIMKAI.ttf"
if font_name == "黑体":
font_name = "SIMHEI.ttf"
if font_name == "等线":
font_name = "DENG.ttf"
if font_name == "仿宋":
font_name = "SIMFANG.ttf"
# 取得字体文件的位置
font_dir = "C:\Windows\Fonts\\" + font_name
font_size = int(pictrue_size * 0.8 / len(text)) # 设定文字的大小
font = ImageFont.truetype(font_dir, font_size)
` may be your font file isn't in "C:\Windows\Fonts\" please correct it ; or your don't have the same font file as me, please go to your font folder and figger it out.
Thank you for replying me. The issue is the lack of the same font file. Thank you for your work.
When I use anaconda environment to run this command, it appears error: cannot open resource. Can you help me out?