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
ImageDraw support for Bangla language #3593
Comments
If I mention that complex text rendering can be used through setting the ImageFont.truetype layout_engine argument to raqm, is that new and helpful information? |
@radarhere still It generate same broken image |
Okay. Loading up a VM instance of Ubuntu 14.04, I tried your script, and it didn't work. So I expect if you try some combination of that, you should find a solution. |
Excellent. |
The following worked for me on Ubuntu 18.04 with Python3.6.7:
from PIL import Image, ImageFont, ImageDraw
im = Image.new("RGB",(160, 160))
draw = ImageDraw.Draw(im)
font_telugu = ImageFont.truetype("/usr/share/fonts/truetype/fonts-telu-extra/Pothana2000.ttf",50)
text_telugu = "నిత్య"
font_hindi = ImageFont.truetype("/usr/share/fonts/truetype/Gargi/Gargi.ttf",50)
text_hindi = "नित्य"
draw.text((10, 10), text_telugu, font=font_telugu)
draw.text((10, 90), text_hindi, font=font_hindi)
im.show() |
@menon92 Did you find any solution for this problem? I am facing the same problem. If find any solution please help me. Thank you. |
how do i fix it for windows? |
Regarding the question from @nazmul284, @menon92 liked this comment, so I presume that worked for them. @zarif25 I suggest installing raqm. https://stackoverflow.com/questions/62939101/how-to-install-pre-built-pillow-wheel-with-libraqm-dlls-on-windows might interest you. |
I followed this comment and could solve the problem in Ubuntu eventually. Step 1: !sudo apt-get install libfreetype6-dev libharfbuzz-dev libfribidi-dev gtk-doc-tools That's it! Now you have a working Pillow library that can produce proper Bengali and other Indic fonts in the image. |
I found a workaround for windows 10 (64 bit). As followed this answer, I put both libraqm.dll and fribidi-0.dll (found in x64 folder and downloaded from pillow_website ) in python.exe folder After that it worked for me. |
I am trying to convert Bangla text to Image using PIL ImageDraw method. To do this is use following code,
It should convert text
দৃষ্টিভঙ্গি
to.png
file. It doesBut the image is broken like below
My OS, Python and Pillow versions
The text was updated successfully, but these errors were encountered: