Open THECH13F opened 9 months ago
If text size is resulting overflow of text, it results in IOError. Based on that, you can use try and catch with recursion until it's finally fits.
def texto(font_size):
try:
text = TextClip(" ").set_duration(duration)
except IOError:
return texto(font_size-4)
return text
Worked for me.
If text size is resulting overflow of text, it results in IOError. Based on that, you can use try and catch with recursion until it's finally fits.
def texto(font_size): try: text = TextClip(" ").set_duration(duration) except IOError: return texto(font_size-4) return text
Worked for me.
not it does not return any error so how will it handle it?
i am making a automated system so that adds text generated by ai will add to a video so i want that i have specified a box width and height and a standard text size so if the text size increase the width and height of the box then it cuts the text but i want that it should decrease the font size untill it fits the box so if you guyz has a solution please help me with that.
thank you