def validate_fonttype(s):
 fonttypes = {'type3': 3, 'truetype': 42}
 try:
  fonttype = validate_int(s)
 except ValueError:
  if (s.lower() in fonttypes.keys()):
   return fonttypes[s.lower()]
  raise ValueError(('Supported Postscript/PDF font types are %s' % fonttypes.keys()))
 else:
  if (fonttype not in fonttypes.values()):
   raise ValueError(('Supported Postscript/PDF font types are %s' % fonttypes.values()))
  return fonttype

def validate_fonttype ( s ) : fonttypes = { 'type3' : 3 , 'truetype' : 42 } try : fonttype = validate_int ( s ) except ValueError : if ( s . lower ( ) in fonttypes . keys ( ) ) : return fonttypes [ s . lower ( ) ] raise ValueError ( ( 'Supported Postscript/PDF font types are %s' % fonttypes . keys ( ) ) ) else : if ( fonttype not in fonttypes . values ( ) ) : raise ValueError ( ( 'Supported Postscript/PDF font types are %s' % fonttypes . values ( ) ) ) return fonttype
confirm that this is a postscript of pdf font type that we know how to convert to .