#NEWLINE# def create_traitsfont( value ) : #NEWLINE# #INDENT# ' Create a TraitFont object from a string description.\n    ' #NEWLINE# if isinstance ( value , wx . Font ) : #NEWLINE# #INDENT# value = font_to_str ( value ) #NEWLINE# #UNINDENT# point_size = None #NEWLINE# family = wx . DEFAULT #NEWLINE# style = wx . NORMAL #NEWLINE# weight = wx . NORMAL #NEWLINE# underline = 0 #NEWLINE# facename = [ ] #NEWLINE# for word in value . split ( ) : #NEWLINE# #INDENT# lword = word . lower ( ) #NEWLINE# if font_families . has_key ( lword ) : #NEWLINE# #INDENT# family = font_families [ lword ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if font_styles . has_key ( lword ) : #NEWLINE# #INDENT# style = font_styles [ lword ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if font_weights . has_key ( lword ) : #NEWLINE# #INDENT# weight = font_weights [ lword ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( lword == 'underline' ) : #NEWLINE# #INDENT# underline = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( lword not in font_noise ) : #NEWLINE# #INDENT# if ( point_size is None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# point_size = int ( lword ) #NEWLINE# continue #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# facename . append ( word ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return TraitsFont ( ( point_size or 10 ) , family , style , weight , underline , ' ' . join ( facename ) )