-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Thai font not supported anymore #7747
Comments
Looking at the images that you've attached, I think you prefer BASIC layout rather than RAQM, and I expect that the change occurred in 8.2.0. When you are opening your font, if you attach font = ImageFont.truetype("./DroidSansThai-Regular.ttf", 124, layout_engine=ImageFont.Layout.BASIC) you should get the result you prefer. |
I agree with @radarhere about which change caused this. but I think you might have the opposite problem, i.e. that you were using RAQM layout before and use BASIC layout now. If @radarhere's suggestion does not fix your issue, please answer the following: How did you install Pillow? |
To answer @radarhere , when adding Traceback (most recent call last):
File "/home/clovis1er/Documents/code/newlogic/png_test/test.py", line 47, in <module>
font = ImageFont.truetype("DroidSansThai.ttf", 60, layout_engine=ImageFont.Layout.BASIC)
AttributeError: module 'PIL.ImageFont' has no attribute 'Layout' To answer @nulano , Here is the output of |
|
I mean the first ~22 lines (i.e. from the first output line to the XCB line). In particular, the FREETYPE2 and RAQM lines are relevant here, but there could be something else helpful in there as well. |
@radarhere @nulano Even though the problem is solved now, here is the output of
|
Is there anything more we can do for you? |
No, thank you very much for your support @radarhere ! |
What did you do?
I am trying to write Thai text on an image.
What did you expect to happen?
Using the following code works perfectly fine in v8.1.2 (see image):

What actually happened?
But in v9.0.1, 9.1.1 and 10.2.0, some characters are overlapping (see image):

What are your OS, Python and Pillow versions?
Note
I tried many fonts, the problem remains whatever the font. For the record, here are the ones I tested:
K2D-Regular.ttf
NotoSerifThai-VariableFont_wdth,wght.ttf
DroidSansThai.ttf
LomaThin.ttf
The text was updated successfully, but these errors were encountered: