'convert the string *s* to vertices and codes by parsing it with
mathtext.'

def get_glyphs_mathtext(self, prop, s, glyph_map=None, return_new_glyphs_only=False):

    prop = prop.copy()
    prop.set_size(self.FONT_SCALE)
    (width, height, descent, glyphs, rects) = self.mathtext_parser.parse(s, self.DPI, prop)
    if (not glyph_map):
        glyph_map = OrderedDict()
    if return_new_glyphs_only:
        glyph_map_new = OrderedDict()
    else:
        glyph_map_new = glyph_map
    xpositions = []
    ypositions = []
    glyph_ids = []
    sizes = []
    (currx, curry) = (0, 0)
    for (font, fontsize, ccode, ox, oy) in glyphs:
        char_id = self._get_char_id(font, ccode)
        if (char_id not in glyph_map):
            font.clear()
            font.set_size(self.FONT_SCALE, self.DPI)
            glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
            glyph_map_new[char_id] = self.glyph_to_path(font)
        xpositions.append(ox)
        ypositions.append(oy)
        glyph_ids.append(char_id)
        size = (fontsize / self.FONT_SCALE)
        sizes.append(size)
    myrects = []
    for (ox, oy, w, h) in rects:
        vert1 = [(ox, oy), (ox, (oy + h)), ((ox + w), (oy + h)), ((ox + w), oy), (ox, oy), (0, 0)]
        code1 = [Path.MOVETO, Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO, Path.CLOSEPOLY]
        myrects.append((vert1, code1))
    return (list(zip(glyph_ids, xpositions, ypositions, sizes)), glyph_map_new, myrects)
