1

I've tried many many things but it didn't fix my problem. what I've tried: changing Font, saving the file as UTF-8, etc... my code:

    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: Result

AmirhN
  • 13
  • 2

1 Answers1

2

Sorry, I see now. The problem is that DejaVuSans does not contain those code points. I tried other Unicode code points (like the line drawing set), and those work fine. You will need to find a font that includes those characters.

Tim Roberts
  • 48,973
  • 4
  • 21
  • 30
  • The question is a little misleading in that it uses code points that look *a lot* like regular ASCII characters. The actual string is `'\U0001d5fa\U0001d5ee\U0001d5f1'`. – Mark Ransom Jun 21 '21 at 19:08
  • Yes, it took me way too long to figure that out. ;) – Tim Roberts Jun 21 '21 at 19:20
  • Don't feel bad, I didn't figure it out either until I saw your answer. Luckily I have a function to grab the actual Unicode from the clipboard: https://stackoverflow.com/a/25678113/5987 – Mark Ransom Jun 21 '21 at 19:25
  • hi, cuz it's for a Discord Welcome Bot, some users may use different fonts and symbols on their names. is there any font to show all characters? – AmirhN Jun 21 '21 at 21:41
  • No. There are fonts that include MANY Unicode code points (Code2000, Arial Unicode), but since emojis change so often, they don't keep up. – Tim Roberts Jun 21 '21 at 21:42