def valid(self):
    if (not self.value):
        return True
    if (self.value in list(FONTPURPOSES.keys())):
        return True
    else:
        return ("Unknown font type: '%s'. Possible: %s" % (self.value, list(FONTPURPOSES.keys())))
def valid(self):
    if (not self.value):
        return True
    if (self.value in list(FONTPURPOSES.keys())):
        return True
    else:
        return ("Unknown font type: '%s'. Possible: %s" % (self.value, list(FONTPURPOSES.keys())))