save_subset_fonts property

FontInfoCollection.save_subset_fonts property

Specifies whether or not to save a subset of the embedded TrueType fonts with the document. Default value for this property is False.

This option works only when FontInfoCollection.embed_true_type_fonts property is set to True.

def save_subset_fonts(self) -> bool:

def save_subset_fonts(self, value: bool):


This option works for DOC, DOCX and RTF formats only.


Shows how to save a document with embedded TrueType fonts.

doc = aw.Document(MY_DIR + 'Document.docx')
font_infos = doc.font_infos
font_infos.embed_true_type_fonts = embed_all_fonts
font_infos.embed_system_fonts = embed_all_fonts
font_infos.save_subset_fonts = embed_all_fonts + 'Font.font_info_collection.docx')
if embed_all_fonts:
    self.assertLess(25000, os.path.getsize(ARTIFACTS_DIR + 'Font.font_info_collection.docx'))
    self.assertGreater(15000, os.path.getsize(ARTIFACTS_DIR + 'Font.font_info_collection.docx'))

See Also