def getFontReader(fontFamily):
	"Get the font reader for the fontFamily."
	fontLower = fontFamily.lower().replace(' ', '_')
	global globalFontReaderDictionary
	if fontLower in globalFontReaderDictionary:
		return globalFontReaderDictionary[fontLower]
	global globalFontFileNames
	if globalFontFileNames == None:
		globalFontFileNames = archive.getFileNamesByFilePaths(archive.getFilePathsByDirectory(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
Esempio n. 2
0
def getFontReader(fontFamily):
    "Get the font reader for the fontFamily."
    fontLower = fontFamily.lower().replace(' ', '_')
    global globalFontReaderDictionary
    if fontLower in globalFontReaderDictionary:
        return globalFontReaderDictionary[fontLower]
    global globalFontFileNames
    if globalFontFileNames == None:
        globalFontFileNames = archive.getFileNamesByFilePaths(
            archive.getFilePathsByDirectory(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
Esempio n. 3
0
def getFontReader(fontFamily):
	'Get the font reader for the fontFamily.'
	fontLower = fontFamily.lower().replace(' ', '_')
	global globalFontReaderDictionary
	if fontLower in globalFontReaderDictionary:
		return globalFontReaderDictionary[fontLower]
	global globalFontFileNames
	if globalFontFileNames is None:
		globalFontFileNames = archive.getFileNamesByFilePaths(archive.getFilePathsByDirectory(getFontsDirectoryPath()))
	if fontLower not in globalFontFileNames:
		print('Warning, the %s font was not found in the fabmetheus_utilities/fonts folder, so Gentium Basic Regular will be substituted.' % fontFamily)
		print('The available fonts are:')
		globalFontFileNames.sort()
		print(globalFontFileNames)
		print('')
		fontLower = 'gentium_basic_regular'
	fontReader = FontReader(fontLower)
	globalFontReaderDictionary[fontLower] = fontReader
	return fontReader
Esempio n. 4
0
def getFontReader(fontFamily):
    'Get the font reader for the fontFamily.'
    fontLower = fontFamily.lower().replace(' ', '_')
    global globalFontReaderDictionary
    if fontLower in globalFontReaderDictionary:
        return globalFontReaderDictionary[fontLower]
    global globalFontFileNames
    if globalFontFileNames is None:
        globalFontFileNames = archive.getFileNamesByFilePaths(
            archive.getFilePathsByDirectory(getFontsDirectoryPath()))
    if fontLower not in globalFontFileNames:
        print(
            'Warning, the %s font was not found in the fabmetheus_utilities/fonts folder, so Gentium Basic Regular will be substituted.'
            % fontFamily)
        print('The available fonts are:')
        globalFontFileNames.sort()
        print(globalFontFileNames)
        print('')
        fontLower = 'gentium_basic_regular'
    fontReader = FontReader(fontLower)
    globalFontReaderDictionary[fontLower] = fontReader
    return fontReader