default_instance property

FontSettings.default_instance property

Static default font settings.

def default_instance(self) -> aspose.words.fonts.FontSettings:


This instance is used by default in a document unless Document.font_settings is specified.


Shows how to configure the default font settings instance.

# Configure the default font settings instance to use the "Courier New" font
# as a backup substitute when we attempt to use an unknown font.
aw.fonts.FontSettings.default_instance.substitution_settings.default_font_substitution.default_font_name = 'Courier New'
doc = aw.Document()
builder = aw.DocumentBuilder(doc) = 'Non-existent font'
builder.write('Hello world!')
# This document does not have a FontSettings configuration. When we render the document,
# the default FontSettings instance will resolve the missing font.
# Aspose.Words will use "Courier New" to render text that uses the unknown font.
self.assertIsNone(doc.font_settings) + 'FontSettings.DefaultFontInstance.pdf')

See Also