Closed navenduagarwal closed 6 years ago
my code as below show up fine , its font related issue use Arial font that tested to be working fine
from PIL import ImageFont, ImageDraw, Image import arabic_reshaper from bidi.algorithm import get_display
image = Image.new('RGB', (200, 200), color='White') draw = ImageDraw.Draw(image)
use a truetype font
reshaped_text = arabic_reshaper.reshape('علامات المحبة') bidi_text = get_display(reshaped_text) font = ImageFont.truetype(font='arial.ttf', size=30)
draw.text((0, 0), bidi_text,font=font, fill=(0,0,0,0))
image.show()
Like @ravarage said it's purely a font issue, use Arial like suggested, or try one of Google's fonts, to my knowledge those fonts have support for all characters, I might be mistaken though, only by testing you'd find out.
See my comment here on issue #20 for a similar case
original text : علامات المحبة
My code is below:
Thanks in advance. Pillow rtl is not working, so I am stuck :(