def textmetrics(self, txt, width=None, height=None, **kwargs): if width is None: width = 0 if height is None: height = 0 r = CanvasContext.textmetrics(self, unicode(txt), width, height) # todo: handle kwargs? return r