'Returns the width of a given text string, in pixels.'

def _get_rendered_text_width(self, text):

    (w, h, d) = self._renderer.get_text_width_height_descent(text, self.get_fontproperties(), False)
    return math.ceil(w)
