Load Custom Fonts
Leave feedback
On this page
GroupDocs.Comparison for Python via .NET can compare documents that use non-standard fonts. Register the custom font directory through a LoadOptions instance before opening the documents.
from groupdocs.comparison import Comparer
from groupdocs.comparison.options import LoadOptions
def load_custom_fonts():
load_options = LoadOptions()
load_options.font_directories.append("./fonts/")
with Comparer("./source.docx", load_options) as comparer:
comparer.add("./target.docx", load_options)
comparer.compare("./result.docx")
if __name__ == "__main__":
load_custom_fonts()
source.docx is the source file used in this example. Click here to download it.
target.docx is the target file used in this example. Click here to download it.
Binary file (DOCX, 11 KB)
The ./fonts/ directory in the example should contain the .otf or .ttf files needed to render the document accurately.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.