Closed khaledmsm closed 2 years ago
Simpler reproducer without Tweepy:
from PIL import Image, ImageDraw, ImageFont
text = "thread emoji: 🧵"
im = Image.new("RGB", (500, 100))
d = ImageDraw.Draw(im)
# https://github.com/google/fonts/blob/main/ofl/notosansarabicui/NotoSansArabicUI%5Bwdth%2Cwght%5D.ttf
fnt = ImageFont.truetype("NotoSansArabicUI[wdth,wght].ttf", 30)
d.text((20, 20), text, font=fnt)
im.save("output.jpg", format="JPEG", subsampling=0, quality=100)
With macOS/Python 3.10/FriBiDi not installed:
i searched for fonts but if i found font thats support emoji its not support the alphabet and if i found one that support alphabet it dosent support emojis
So you can actually get Pillow to work with emojis, and you can get Pillow to work with arabic characters, just not both in the same font? I think this is just a duplicate of #4808.
Perhaps the most helpful comment in that issue at the moment is https://github.com/python-pillow/Pillow/issues/4808#issuecomment-1141719845, where a user describes how to merge two fonts into one using Python.
i searched for fonts but if i found font thats support emoji its not support the alphabet and if i found one that support alphabet it dosent support emojis
So you can actually get Pillow to work with emojis, and you can get Pillow to work with arabic characters, just not both in the same font? I think this is just a duplicate of #4808.
Perhaps the most helpful comment in that issue at the moment is #4808 (comment), where a user describes how to merge two fonts into one using Python.
thanks alot
What did you do?
I'm currently programming a bot that copy tweets that mention on and paste it on image I'm using python , pillow , tweepy
when the bot get the tweet text from api and trying to paste it on image the emojis cant show on image , i tried a notocolor and other fonts but the issue doesn't fixed
also im using libraqm because the main language of the project is arabic
What did you expect to happen?
ican see the emojis thats get from tweepy api thats included on tweets
What actually happened?
icant see the emojis thats get from tweepy api thats included on tweets and i searched for fonts but if i found font thats support emoji its not support the alphabet and if i found one that support alphabet it dosent support emojis
and this a results https://i.stack.imgur.com/QBMqE.jpg https://i.stack.imgur.com/JDPP2.jpg and this original tweet https://i.stack.imgur.com/wagTI.png
What are your OS, Python and Pillow versions?