【发布时间】:2021-09-05 10:34:50
【问题描述】:
我尝试了很多很多方法,但都没有解决我的问题。 我尝试过:更改字体、将文件保存为 UTF-8 等... 我的代码:
img = Image.open("WlcImageThings/bg.png")
txtUser_font = ImageFont.truetype('WlcImageThings/DejaVuSans.ttf', 25)
eimg = ImageDraw.Draw(img)
eimg.text((25,50), u'????????????', (237, 230, 211), font=txtUser_font, stroke_width=2, stroke_fill=(0, 0, 0))
img.save("WlcImageThings/result.png", quality=100)
file = discord.File("WlcImageThings/result.png", filename="result.png")
await channel.send(file=file)
结果: Result
【问题讨论】:
-
你的问题是什么?你还没有真正问过问题。
-
这能回答你的问题吗? How to use unicode characters with PIL?
标签: python discord python-imaging-library