This project offers a simple and intuitive interface for users to input text and generate images that showcase the text in a handwritten style. The generator supports several stylistic modifications including bold, underline, and color alterations, allowing users to create personalized and visually appealing images from their text.
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
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