'Return the string width (including kerning) and string height
as a (*w*, *h*) tuple.'

def string_width_height(self, s):

    if (not len(s)):
        return (0, 0)
    totalw = 0
    namelast = None
    miny = 1000000000.0
    maxy = 0
    for c in s:
        if (c == u'\n'):
            continue
        (wx, name, bbox) = self._metrics[ord(c)]
        (l, b, w, h) = bbox
        try:
            kp = self._kern[(namelast, name)]
        except KeyError:
            kp = 0
        totalw += (wx + kp)
        thismax = (b + h)
        if (thismax > maxy):
            maxy = thismax
        thismin = b
        if (thismin < miny):
            miny = thismin
        namelast = name
    return (totalw, (maxy - miny))
