def __init__(self, text='',
                 font_name=None, font_size=None, bold=False, italic=False,
                 color=None,
                 x=0, y=0, width=None, height=None,
                 anchor_x='left', anchor_y='baseline',
                 align='left',
                 multiline=False, dpi=None, batch=None, group=None):

        text = '{color (255, 255, 255, 255)}' + text
        document = pyglet.text.decode_attributed(text)
        super(PygletRichLabel, self).__init__(document, x, y, width, height,
                                              anchor_x, anchor_y,
                                              multiline, dpi, batch, group)
        style = dict(align=align)

        if font_name:
            style['font_name'] = font_name
        if font_size:
            style['font_size'] = font_size
        if bold:
            style['bold'] = bold
        if italic:
            style['italic'] = italic
        if color:
            style['color'] = color

        self.document.set_style(0, len(self.document.text), style)
Utility to process style properties converting any
dataset/ETHPy150Open los-cocos/cocos/cocos/text.py/PygletRichLabel.__init__--crossover with--dataset/ETHPy150Open ioam/holoviews/holoviews/plotting/bokeh/util.py/mpl_to_bokeh