python imaging library draw text new line how to?
i have a word that will be putted on a image but the problem is that the word continues 开发者_如何学Pythoneven though the word exceeds the width of the image
is there anyway that the word shift's down if the word exceeds the width of the image or on a certain point the word shift's down if it exceeds the given point
PIL won't automatically do this, but you could easily do it yourself using the getsize
method in the ImageFont
module. That is, if the text is too big, just split it so that it's not, and put the rest on the next line. (You may want to do this recursively in case the text spans multiple lines.)
精彩评论