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
hi, im succesfully run the code. but when im trying to export, there's error on line 106.
this the error message;
line 106, in on_export_image
char_width = temp_draw.textsize(char, font=font)[0]
^^^^^^^^^^^^^^^^^^
AttributeError: 'ImageDraw' object has no attribute 'textsize'.
and this is the code ;
def on_export_image(self, event):
lines = self.richTextCtrl.GetValue().split('\n')
selected_font = self.font_choice.GetStringSelection()
max_line_width = 0
temp_image = Image.new("RGBA", (1, 1))
temp_draw = ImageDraw.Draw(temp_image)
for line_no, line in enumerate(lines):
line_width = 0
for char in line:
font = ImageFont.truetype(f"./fonts/{selected_font}", self.font_size)
106---> char_width = temp_draw.textsize(char, font=font)[0]
line_width += char_width
i've already rewrite and trying fix the problem by changing the code, but the error still the same. maybe anyone or the developer it self can help. because this is for my class project. thanksss
The text was updated successfully, but these errors were encountered:
hi, im succesfully run the code. but when im trying to export, there's error on line 106.
this the error message;
line 106, in on_export_image
char_width = temp_draw.textsize(char, font=font)[0]
^^^^^^^^^^^^^^^^^^
AttributeError: 'ImageDraw' object has no attribute 'textsize'.
and this is the code ;
i've already rewrite and trying fix the problem by changing the code, but the error still the same. maybe anyone or the developer it self can help. because this is for my class project. thanksss
The text was updated successfully, but these errors were encountered: