#NEWLINE# def set_vmetrics_lineheight( font , ratio = None , line_space = None ) : #NEWLINE# #INDENT# if ( ratio is None ) : #NEWLINE# #INDENT# ratio = 0.75 #NEWLINE# #UNINDENT# if ( line_space is None ) : #NEWLINE# #INDENT# line_auto = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# line_auto = False #NEWLINE# #UNINDENT# units_per_em = font . info . unitsPerEm #NEWLINE# ascender = ( units_per_em * ratio ) #NEWLINE# descender = ( units_per_em * ( 1.0 - ratio ) ) #NEWLINE# if line_auto : #NEWLINE# #INDENT# ( ymin , ymax ) = get_min_max_y ( font , r = 5 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ymin = ( - ( descender * line_space ) ) #NEWLINE# ymax = ( ascender * line_space ) #NEWLINE# #UNINDENT# auto_set_vmetrics ( font , ascender , descender , ymax , ymin )