def getFontReader(fontFamily):
 fontLower = fontFamily.lower().replace(' ', '_')
 global globalFontReaderDictionary
 if (fontLower in globalFontReaderDictionary):
  return globalFontReaderDictionary[fontLower]
 global globalFontFileNames
 if (globalFontFileNames == None):
  globalFontFileNames = archive.getPluginFileNamesFromDirectoryPath(getFontsDirectoryPath())
 if (fontLower not in globalFontFileNames):
  print ('Warning, the %s font was not found in the fonts folder, so Gentium Basic Regular will be substituted.' % fontFamily)
  fontLower = 'gentium_basic_regular'
 fontReader = FontReader(fontLower)
 globalFontReaderDictionary[fontLower] = fontReader
 return fontReader

def getFontReader ( fontFamily ) : fontLower = fontFamily . lower ( ) . replace ( ' ' , '_' ) global globalFontReaderDictionary if ( fontLower in globalFontReaderDictionary ) : return globalFontReaderDictionary [ fontLower ] global globalFontFileNames if ( globalFontFileNames == None ) : globalFontFileNames = archive . getPluginFileNamesFromDirectoryPath ( getFontsDirectoryPath ( ) ) if ( fontLower not in globalFontFileNames ) : print ( 'Warning, the %s font was not found in the fonts folder, so Gentium Basic Regular will be substituted.' % fontFamily ) fontLower = 'gentium_basic_regular' fontReader = FontReader ( fontLower ) globalFontReaderDictionary [ fontLower ] = fontReader return fontReader
get the font reader for the fontfamily .