开发者

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.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜