name property

FontInfo.name property

Gets the name of the font.

@property
def name(self) -> str:
    ...

Remarks

Cannot be None. Can be an empty string.

Examples

Shows how to print the details of what fonts are present in a document.

doc = aw.Document(MY_DIR + "Embedded font.docx")

all_fonts = doc.font_infos

# Print all the used and unused fonts in the document.
for i in range(all_fonts.count):
    print(f"Font index #{i}")
    print(f"\tName: {all_fonts[i].name}")
    print(f'\tIs {"" if all_fonts[i].is_true_type else "not "}a TrueType font')

See Also