def os2_yaml_formatter(table_dict):
 table_string = 'OS/2: {\n'
 for field in table_dict.keys():
  if (field == 'panose'):
   table_string = (((table_string + (' ' * 4)) + field) + ': {\n')
   panose_string = ''
   panose_dict = table_dict['panose'].__dict__
   for panose_field in panose_dict.keys():
    panose_string = (((((panose_string + (' ' * 8)) + panose_field[1:]) + ': ') + str(panose_dict[panose_field])) + ',\n')
   table_string = (((table_string + panose_string) + (' ' * 4)) + '}\n')
  else:
   table_string = (((((table_string + (' ' * 4)) + field) + ': ') + str(table_dict[field])) + ',\n')
 table_string = (table_string + '}\n\n')
 return table_string

def os2_yaml_formatter ( table_dict ) : table_string = 'OS/2: {\n' for field in table_dict . keys ( ) : if ( field == 'panose' ) : table_string = ( ( ( table_string + ( ' ' * 4 ) ) + field ) + ': {\n' ) panose_string = '' panose_dict = table_dict [ 'panose' ] . __dict__ for panose_field in panose_dict . keys ( ) : panose_string = ( ( ( ( ( panose_string + ( ' ' * 8 ) ) + panose_field [ 1 : ] ) + ': ' ) + str ( panose_dict [ panose_field ] ) ) + ',\n' ) table_string = ( ( ( table_string + panose_string ) + ( ' ' * 4 ) ) + '}\n' ) else : table_string = ( ( ( ( ( table_string + ( ' ' * 4 ) ) + field ) + ': ' ) + str ( table_dict [ field ] ) ) + ',\n' ) table_string = ( table_string + '}\n\n' ) return table_string
formats the yaml table string for opentype os/2 tables .