'draw the text by converting them to paths using textpath module.
Parameters
prop : `matplotlib.font_manager.FontProperties`
font property
s : str
text to be converted
usetex : bool
If True, use matplotlib usetex mode.
ismath : bool
If True, use mathtext parser. If "TeX", use *usetex* mode.'

def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath, mtext=None):

    writer = self.writer
    writer.comment(s)
    glyph_map = self._glyph_map
    text2path = self._text2path
    color = rgb2hex(gc.get_rgb())
    fontsize = prop.get_size_in_points()
    style = {}
    if (color != u'#000000'):
        style[u'fill'] = color
    if (gc.get_alpha() != 1.0):
        style[u'opacity'] = short_float_fmt(gc.get_alpha())
    if (not ismath):
        font = text2path._get_font(prop)
        _glyphs = text2path.get_glyphs_with_font(font, s, glyph_map=glyph_map, return_new_glyphs_only=True)
        (glyph_info, glyph_map_new, rects) = _glyphs
        if glyph_map_new:
            writer.start(u'defs')
            for (char_id, glyph_path) in six.iteritems(glyph_map_new):
                path = Path(*glyph_path)
                path_data = self._convert_path(path, simplify=False)
                writer.element(u'path', id=char_id, d=path_data)
            writer.end(u'defs')
            glyph_map.update(glyph_map_new)
        attrib = {}
        attrib[u'style'] = generate_css(style)
        font_scale = (fontsize / text2path.FONT_SCALE)
        attrib[u'transform'] = generate_transform([(u'translate', (x, y)), (u'rotate', ((- angle),)), (u'scale', (font_scale, (- font_scale)))])
        writer.start(u'g', attrib=attrib)
        for (glyph_id, xposition, yposition, scale) in glyph_info:
            attrib = {u'xlink:href': (u'#%s' % glyph_id)}
            if (xposition != 0.0):
                attrib[u'x'] = short_float_fmt(xposition)
            if (yposition != 0.0):
                attrib[u'y'] = short_float_fmt(yposition)
            writer.element(u'use', attrib=attrib)
        writer.end(u'g')
    else:
        if (ismath == u'TeX'):
            _glyphs = text2path.get_glyphs_tex(prop, s, glyph_map=glyph_map, return_new_glyphs_only=True)
        else:
            _glyphs = text2path.get_glyphs_mathtext(prop, s, glyph_map=glyph_map, return_new_glyphs_only=True)
        (glyph_info, glyph_map_new, rects) = _glyphs
        if glyph_map_new:
            writer.start(u'defs')
            for (char_id, glyph_path) in six.iteritems(glyph_map_new):
                char_id = self._adjust_char_id(char_id)
                if (not len(glyph_path[0])):
                    path_data = u''
                else:
                    path = Path(*glyph_path)
                    path_data = self._convert_path(path, simplify=False)
                writer.element(u'path', id=char_id, d=path_data)
            writer.end(u'defs')
            glyph_map.update(glyph_map_new)
        attrib = {}
        font_scale = (fontsize / text2path.FONT_SCALE)
        attrib[u'style'] = generate_css(style)
        attrib[u'transform'] = generate_transform([(u'translate', (x, y)), (u'rotate', ((- angle),)), (u'scale', (font_scale, (- font_scale)))])
        writer.start(u'g', attrib=attrib)
        for (char_id, xposition, yposition, scale) in glyph_info:
            char_id = self._adjust_char_id(char_id)
            writer.element(u'use', transform=generate_transform([(u'translate', (xposition, yposition)), (u'scale', (scale,))]), attrib={u'xlink:href': (u'#%s' % char_id)})
        for (verts, codes) in rects:
            path = Path(verts, codes)
            path_data = self._convert_path(path, simplify=False)
            writer.element(u'path', d=path_data)
        writer.end(u'g')
