'draw a Text instance'

def draw_tex(self, gc, x, y, s, prop, angle, ismath=u'TeX!', mtext=None):

    (w, h, bl) = self.get_text_width_height_descent(s, prop, ismath)
    fontsize = prop.get_size_in_points()
    thetext = (u'psmarker%d' % self.textcnt)
    color = (u'%1.3f,%1.3f,%1.3f' % gc.get_rgb()[:3])
    fontcmd = {u'sans-serif': u'{\\sffamily    %s}', u'monospace': u'{\\ttfamily    %s}'}.get(rcParams[u'font.family'][0], u'{\\rmfamily    %s}')
    s = (fontcmd % s)
    tex = (u'\\color[rgb]{%s}    %s' % (color, s))
    corr = 0
    if rcParams[u'text.latex.preview']:
        pos = _nums_to_str((x - corr), y)
        self.psfrag.append((u'\\psfrag{%s}[Bl][Bl][1][%f]{\\fontsize{%f}{%f}%s}' % (thetext, angle, fontsize, (fontsize * 1.25), tex)))
    else:
        pos = _nums_to_str((x - corr), (y - bl))
        self.psfrag.append((u'\\psfrag{%s}[bl][bl][1][%f]{\\fontsize{%f}{%f}%s}' % (thetext, angle, fontsize, (fontsize * 1.25), tex)))
    ps = (u'gsave\n%(pos)s    moveto\n(%(thetext)s)\nshow\ngrestore\n                ' % locals())
    self._pswriter.write(ps)
    self.textcnt += 1
