def afmFontProperty(fontpath, font):
 name = font.get_familyname()
 if ((font.get_angle() != 0) or (name.lower().find('italic') >= 0)):
  style = 'italic'
 elif (name.lower().find('oblique') >= 0):
  style = 'oblique'
 else:
  style = 'normal'
 if (name.lower() in ['capitals', 'small-caps']):
  variant = 'small-caps'
 else:
  variant = 'normal'
 weight = weight_as_number(font.get_weight().lower())
 stretch = 'normal'
 size = 'scalable'
 size_adjust = None
 return FontEntry(fontpath, name, style, variant, weight, stretch, size)

def afmFontProperty ( fontpath , font ) : name = font . get_familyname ( ) if ( ( font . get_angle ( ) != 0 ) or ( name . lower ( ) . find ( 'italic' ) >= 0 ) ) : style = 'italic' elif ( name . lower ( ) . find ( 'oblique' ) >= 0 ) : style = 'oblique' else : style = 'normal' if ( name . lower ( ) in [ 'capitals' , 'small-caps' ] ) : variant = 'small-caps' else : variant = 'normal' weight = weight_as_number ( font . get_weight ( ) . lower ( ) ) stretch = 'normal' size = 'scalable' size_adjust = None return FontEntry ( fontpath , name , style , variant , weight , stretch , size )
a function for populating a :class:fontkey instance by extracting information from the afm font file .