type property

MemoryFontSource.type property

Returns the type of the font source.

def type(self) -> aspose.words.fonts.FontSourceType:


Shows how to use a byte array with data from a font file as a font source.

with open(MY_DIR + 'Alte DIN 1451 Mittelschrift.ttf', 'rb') as file:
    font_bytes = file.read()
memory_font_source = aw.fonts.MemoryFontSource(font_bytes, 0)
doc = aw.Document()
doc.font_settings = aw.fonts.FontSettings()
self.assertEqual(aw.fonts.FontSourceType.MEMORY_FONT, memory_font_source.type)
self.assertEqual(0, memory_font_source.priority)

See Also