#NEWLINE# def getExtents( self , text = None ) : #NEWLINE# #INDENT# F = self . ctx . font_extents ( ) #NEWLINE# extents = { #NEWLINE# #INDENT# 'maxHeight' : F [ 2 ] , #NEWLINE# 'maxAscent' : F [ 0 ] , #NEWLINE# 'maxDescent' : F [ 1 ] , #NEWLINE# #UNINDENT# } #NEWLINE# if text : #NEWLINE# #INDENT# T = self . ctx . text_extents ( text ) #NEWLINE# extents [ 'width' ] = T [ 4 ] #NEWLINE# extents [ 'height' ] = T [ 3 ] #NEWLINE# #UNINDENT# return extents