def makeLongLineToLines(long_line, start_x, start_y, width, line_height, font, cn_char_width=0):
    u'将一个长行分成多个可显示的短行'
    txt = long_line
    if (not txt):
        return [None]
    words = makeLineToWordsList(txt)
    lines = []
    if (not cn_char_width):
        (cn_char_width, h) = font.size(u'汉')
    avg_char_per_line = (width / cn_char_width)
    if (avg_char_per_line <= 1):
        avg_char_per_line = 1
    line_x = start_x
    line_y = start_y
    while words:
        tmp_words = words[:avg_char_per_line]
        tmp_ln = ''.join(tmp_words)
        (w, h) = font.size(tmp_ln)
        wc = len(tmp_words)
        while ((w < width) and (wc < len(words))):
            wc += 1
            tmp_words = words[:wc]
            tmp_ln = ''.join(tmp_words)
            (w, h) = font.size(tmp_ln)
        while ((w > width) and (len(tmp_words) > 1)):
            tmp_words = tmp_words[:(- 1)]
            tmp_ln = ''.join(tmp_words)
            (w, h) = font.size(tmp_ln)
        if ((w > width) and (len(tmp_words) == 1)):
            line_y = makeLongWordToLines(tmp_words[0], line_x, line_y, width, line_height, font, lines)
            words = words[len(tmp_words):]
            continue
        line = {'x': line_x, 'y': line_y, 'text': tmp_ln, 'font': font}
        line_y += line_height
        words = words[len(tmp_words):]
        lines.append(line)
        if (len(lines) >= 1):
            while ((len(words) > 0) and (not words[0].strip())):
                words = words[1:]
    return lines
将一个长行分成多个可显示的短行
def makeLongLineToLines(long_line, start_x, start_y, width, line_height, font, cn_char_width=0):
    u
    txt = long_line
    if (not txt):
        return [None]
    words = makeLineToWordsList(txt)
    lines = []
    if (not cn_char_width):
        (cn_char_width, h) = font.size(u'汉')
    avg_char_per_line = (width / cn_char_width)
    if (avg_char_per_line <= 1):
        avg_char_per_line = 1
    line_x = start_x
    line_y = start_y
    while words:
        tmp_words = words[:avg_char_per_line]
        tmp_ln = .join(tmp_words)
        (w, h) = font.size(tmp_ln)
        wc = len(tmp_words)
        while ((w < width) and (wc < len(words))):
            wc += 1
            tmp_words = words[:wc]
            tmp_ln = .join(tmp_words)
            (w, h) = font.size(tmp_ln)
        while ((w > width) and (len(tmp_words) > 1)):
            tmp_words = tmp_words[:(- 1)]
            tmp_ln = .join(tmp_words)
            (w, h) = font.size(tmp_ln)
        if ((w > width) and (len(tmp_words) == 1)):
            line_y = makeLongWordToLines(tmp_words[0], line_x, line_y, width, line_height, font, lines)
            words = words[len(tmp_words):]
            continue
        line = {'x': line_x, 'y': line_y, 'text': tmp_ln, 'font': font}
        line_y += line_height
        words = words[len(tmp_words):]
        lines.append(line)
        if (len(lines) >= 1):
            while ((len(words) > 0) and (not words[0].strip())):
                words = words[1:]
    return lines