'Get the width, height, and descent (offset from the bottom
to the baseline), in display coords, of the string *s* with
:class:`~matplotlib.font_manager.FontProperties` *prop*'

def get_text_width_height_descent(self, s, prop, ismath):

    if rcParams[u'text.usetex']:
        size = prop.get_size_in_points()
        texmanager = self.get_texmanager()
        fontsize = prop.get_size_in_points()
        (w, h, d) = texmanager.get_text_width_height_descent(s, fontsize, renderer=self)
        return (w, h, d)
    if ismath:
        (ox, oy, width, height, descent, fonts, used_characters) = self.mathtext_parser.parse(s, self.dpi, prop)
        return (width, height, descent)
    flags = get_hinting_flag()
    font = self._get_agg_font(prop)
    font.set_text(s, 0.0, flags=flags)
    (w, h) = font.get_width_height()
    d = font.get_descent()
    w /= 64.0
    h /= 64.0
    d /= 64.0
    return (w, h, d)
