Hey, I'm currently trying to create videos with Moviepy but run into a few problems with the text.
First problem: weird artifacts inside the text when applying stroke
Solution: Add another text layer on top without stroke.
Second Problem: Text without stroke and with stroke doesn't 100% align correctly.
Here are 2 Images. The first one is how the Moviepy file is exported with weird alignment. The second is a Figma file of how it should look like.
MoviePy Export (note: the stroke size is bigger than the Figma file stroke to showcase the issue)
Hey, I'm currently trying to create videos with Moviepy but run into a few problems with the text.
Solution: Add another text layer on top without stroke.
Here are 2 Images. The first one is how the Moviepy file is exported with weird alignment. The second is a Figma file of how it should look like. MoviePy Export (note: the stroke size is bigger than the Figma file stroke to showcase the issue)
Example of what it should look like.
Here is some of the code:
Create text clips with stroke
english_text_stroke = TextClip(english_word, fontsize=font_size, color='white', font=font_path, stroke_color='black', stroke_width=3)
spanish_text_stroke = TextClip(spanish_word, fontsize=font_size, color='white', font=font_path, stroke_color='black', stroke_width=3)
Create text clips without stroke (to overlay on top)
english_text = TextClip(english_word, fontsize=font_size, color='white', font=font_path)
spanish_text = TextClip(spanish_word, fontsize=font_size, color='white', font=font_path)
Position text clips
english_text_stroke = english_text_stroke.set_position((left_column_x - english_text.w // 2, y_position))
spanish_text_stroke = spanish_text_stroke.set_position((right_column_x - spanish_text.w // 2, y_position))
english_text = english_text.set_position((left_column_x - english_text.w // 2, y_position))
spanish_text = spanish_text.set_position((right_column_x - spanish_text.w // 2, y_position))
Does anyone know of any solutions?