Open GitPavan123 opened 2 days ago
Hi. Do you have raqm installed?
>>> from PIL import features
>>> features.check("raqm")
True
No what is it's used for?
Complex text rendering. It is "recommended for all non-English text". See https://github.com/python-pillow/Pillow/issues/6018#issuecomment-1030893495 for an instance where using Raqm has solved Tamil rendering in the past.
How did you install Pillow?
If you're a Windows user, I suggest looking at https://pillow.readthedocs.io/en/stable/installation/building-from-source.html
On Windows this requires compiling FriBiDi and installing fribidi.dll into a directory listed in the Dynamic-link library search order (Microsoft Learn) (fribidi-0.dll or libfribidi-0.dll are also detected).
I installed pillow in my conda environment using the command "pip install pillow". But even though i upgrade my pillow version still it returns false for the checking the existence of raqm.
What operating system are you using?
Could you uninstall Pillow, and then run pip install -v Pillow
and show us the output?
I am using windows os
Have you attempted placing fribidi in the correct location? Here is fribidi.dll from our recent Pillow 11.0.0 release for various architectures - fribidi.zip
https://pillow.readthedocs.io/en/stable/installation/building-from-source.html
On Windows this requires compiling FriBiDi and installing fribidi.dll into a directory listed in the Dynamic-link library search order (Microsoft Learn) (fribidi-0.dll or libfribidi-0.dll are also detected).
I have installed raqm and now i get true for the following code,
>>> from PIL import features
>>> features.check("raqm")
Now how do i enable or activate raqm to render text in matplotlib pie chart?
Hmm. I would have expected the correct output from matplotlib once you had done that.
If matplotlib is still not working as you expect, does the following Pillow-only code work?
from PIL import Image, ImageDraw, ImageFont
font = ImageFont.truetype(r"Fonts\Tamil Font.TTF", 25)
im = Image.new("RGB", (250, 250))
draw = ImageDraw.Draw(im)
for i, text in enumerate(['எனக்கு ', 'மின்விசிறி', 'கலை', 'வாழைப்பழம்']):
draw.text((20, 20+i*50), text, font=font, fill="white")
im.show()
I have been working on with a project in matplotlib. I'm trying to display tamil texts in a pie chart. I did downloaded and specified the appropriate font paths (In my case Brahmini, Noto sans tamil, Tiro, etc...) Everything does render the tamil font but it is completely in a wrong manner. Figure(1) is the actual rendering. Figure(2) is the required rendering.
CODING