You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
textwrapped="Hello, world! 👋 Here are some emojis: 🎨 🌊 😎"font=ImageFont.truetype(THIS_FOLDER+"/fonts/seguiemj.ttf", font_size) //[mergedfont](https://github.com/thedemons/merge_color_emoji_font)
d.text((int(qx),int(qy)), text=textwrapped, align="center", fill="#fff", font=font, embedded_color=True)
What did you expect to happen?
center multiline text
What actually happened?
if i use "embedded_color=True" together with "align=center" i get this error:
d.text((int(qx),int(qy)), text=textwrapped, align="center", fill="#fff", font=font, embedded_color=True)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\ImageDraw.py", line 409, in text
return self.multiline_text(
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\ImageDraw.py", line 563, in multiline_text
self.text(
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\ImageDraw.py", line 498, in text
draw_text(ink)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\ImageDraw.py", line 480, in draw_text
self.im.paste(color, coord + coord2, mask)
TypeError: 'float' object cannot be interpreted as an integer
I've created PR #6517 to resolve this. The problem is occurring for multiline center aligned embedded color text.
radarhere
changed the title
I can't use "align=center" together with "embedded_color=True"
Can't use "align=center" together with "embedded_color=True"
Aug 22, 2022
What did you do?
What did you expect to happen?
center multiline text
What actually happened?
if i use "embedded_color=True" together with "align=center" i get this error:
If i remove "align=center" see here: https://imgur.com/a/rLnenPj - embedded color works fine:
If i remove "embedded_color=True" see here: https://imgur.com/a/Exq6aYe - align center works fine:
but they cant work together.
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: