我尝试了很多方法,但都没有解决我的问题。 我尝试过的:更改字体,将文件保存为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
对不起,我现在明白了。问题是DejaVuSans不包含这些代码点。我尝试了其他Unicode代码点(比如线描集),这些都很好。您需要找到包含这些字符的字体
相关问题 更多 >
编程相关推荐