Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render emojis with zwj #8380

Closed
wlt233 opened this issue Sep 14, 2024 · 2 comments
Closed

Render emojis with zwj #8380

wlt233 opened this issue Sep 14, 2024 · 2 comments

Comments

@wlt233
Copy link

wlt233 commented Sep 14, 2024

What did you do?

from PIL import Image, ImageDraw, ImageFont

text = "πŸ‘©β€πŸš’"

font = ImageFont.truetype("seguiemj.ttf", 100)
base = Image.new("RGB", (500, 300), "#FFF")
draw = ImageDraw.Draw(base)
draw.text((50, 50), text, font=font, embedded_color=True, fill="#000")
base.show()

E.g. πŸ‘©β€πŸš’ is encoded as:

  • πŸ‘© U+1F469
  • U+200D (the ZWJ)
  • πŸš’ U+1F692

What did you expect to happen?

show a single emoji like in browser
image

What actually happened?

the emoji was split into three parts and rendered respectively
image

What are your OS, Python and Pillow versions?

@nulano
Copy link
Contributor

nulano commented Sep 14, 2024

Works for me:
image

I suspect you are missing RAQM support. Please provide the output of the python3 -m PIL.report command or the import PIL.report Python statement to confirm.

@wlt233
Copy link
Author

wlt233 commented Sep 14, 2024

you are right, thanks a lot

@wlt233 wlt233 closed this as completed Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants