#NEWLINE# def validate( self , object , name , value ) : #NEWLINE# #INDENT# ' Validates that the value is a valid font descriptor string. If so,\n        it returns the corresponding TraitsFont; otherwise, it raises a\n        TraitError.\n        ' #NEWLINE# if ( value is None ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return create_traitsfont ( value ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# raise TraitError ( object , name , 'a font descriptor string' , repr ( value ) )