I am trying to render Bengali fonts correctly in blender, but it is not rendering properly. I faced the same problem trying to draw Bengali text on image with python. I found that pillow is able to do this, but it was not straightforward like English text. I was able to get it working following these two links below,
How do I install 'libraqm' library in Google Colab?
How to install pre-built Pillow wheel with libraqm DLLs on Windows?
These are the results without and with libraqm,
Incorrect
Correct
This is the basic code,
from PIL import ImageFont, ImageDraw, Image
import numpy as np
import matplotlib.pyplot as plt
image = np.zeros((200, 600, 3), np.uint8)
image = Image.fromarray(np.uint8(image * 255))
draw = ImageDraw.Draw(image)
# use a truetype font
font = ImageFont.truetype("/content/BalooDa2-Medium.ttf", 24)
draw.text((20, 25), "আমাদের দেশের ক্রিকেটাররা এখন টেস্ট খেলায় জিততে জানে", font=font)
draw.text((20, 50), "গরমে সুস্থ থাকুন", font=font)
plt.figure(figsize = (20,20))
plt.imshow(image)
Full script is here, https://github.com/quickgrid/CodeLab/blob/master/colab/Pillow_Render_Bangla_Font_Text_to_Image_libraqm.ipynb.
Using custom Bengali font in blender produces incorrect result like this
I am wondering how to achieve the same thing as libraqm in blender with text. Any way to install libraqm with pillow to render font properly in blender or any other ways?