'Convert a compound string into attributes
# incomplete because formatting commands can be nested'

def set(self, text):

    if (text is None):
        return
    m = FONT_REGEX.search(text)
    if m:
        self.font_name = m.group('font')
        text = FONT_REGEX.sub('', text)
    m = SIZE_REGEX.search(text)
    if m:
        self.font_size = int(m.group('size'))
        text = SIZE_REGEX.sub('', text)
    m = COLOR_REGEX.search(text)
    if m:
        self.font_color = m.group('color')
        text = COLOR_REGEX.sub('', text)
    self.text = text
