This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import ImageFont | |
def get_wrapped_text(text, PIL_font, max_width): | |
# Returns a list where each item is a line of text that does not exceed | |
# the max_width. If there should be any single word that is bigger than | |
# the max_width argument, it will be shown in an individual line, even | |
# though it exceeds the max_width. | |
lines = [] |