FontSourceType enumeration

FontSourceType enumeration

Specifies the type of font source.

Members

NameDescription
FONT_FILEA FileFontSource object that represents single font file.
FONTS_FOLDERA FolderFontSource object that represents folder with font files.
MEMORY_FONTA MemoryFontSource object that represents single font in memory.
SYSTEM_FONTSA SystemFontSource object that represents all fonts installed to the system.
FONT_STREAMA StreamFontSource object that represents a stream with font data.

Examples

Shows how to use a font file in the local file system as a font source.

file_font_source = aw.fonts.FileFontSource(file_path=MY_DIR + 'Alte DIN 1451 Mittelschrift.ttf', priority=0)
doc = aw.Document()
doc.font_settings = aw.fonts.FontSettings()
doc.font_settings.set_fonts_sources(sources=[file_font_source])
self.assertEqual(MY_DIR + 'Alte DIN 1451 Mittelschrift.ttf', file_font_source.file_path)
self.assertEqual(aw.fonts.FontSourceType.FONT_FILE, file_font_source.type)
self.assertEqual(0, file_font_source.priority)

See Also