def SetCustomFonts(rmldoc):
 for (family, font, filename, mode) in CustomTTFonts:
  if (os.path.isabs(filename) and os.path.exists(filename)):
   rmldoc.setTTFontMapping(family, font, filename, mode)
 return True

def SetCustomFonts ( rmldoc ) : for ( family , font , filename , mode ) in CustomTTFonts : if ( os . path . isabs ( filename ) and os . path . exists ( filename ) ) : rmldoc . setTTFontMapping ( family , font , filename , mode ) return True
map some font names to the corresponding ttf fonts the ttf font may not even have the same name .