Calculates the width of the specified text.

def textwidth(self, text, config):
        """Calculates the width of the specified text.
        """
        surface = cairo.SVGSurface(None, 1280, 200)
        ctx = cairo.Context(surface)
        ctx.select_font_face(config['font_face'],
                             cairo.FONT_SLANT_NORMAL,
                             cairo.FONT_WEIGHT_BOLD)
        ctx.set_font_size(int(config['font_size']))
        return ctx.text_extents(text)[2] + 2