def CutText(text, textlen, cutchars=' ;:,.\r\n', postfix=' ...'):
    """
    For text preview. cut the text at the last found char in cutchars.
    """
    if len(text) < textlen:
        return text
    pos = len(text) - 1
    for c in cutchars:
        p = text.find(c, textlen)
        if p != -1 and p < pos:
            pos = p
    return text[:pos] + postfix
