def string_width_height(self, s):
if not len(s): return <NUM_LIT:0>,<NUM_LIT:0><EOL>totalw = <NUM_LIT:0><EOL>namelast = None<EOL>miny = <NUM_LIT><EOL>maxy = <NUM_LIT:0><EOL>for c in s:<EOL><INDENT>if c == '<STR_LIT:\n>': continue<EOL>wx, name, bbox = self._metrics[ord(c)]<EOL>l,b,w,h = bbox<EOL>try: kp = self._kern[ (namelast, name) ]<EOL>except KeyError: kp = <NUM_LIT:0><EOL>totalw += wx + kp<EOL>thismax = b+h<EOL>if thismax>maxy: maxy = thismax<EOL>thismin = b<EOL>if thismin<miny: miny = thismin<EOL><DEDENT>return totalw, maxy-miny<EOL>
Return the string width (including kerning) and string height
as a (*w*, *h*) tuple.