FontFallbackSettingsLoadNotoFallbackSettings Method

Loads predefined fallback settings which uses Google Noto fonts.

Namespace:  Aspose.Words.Fonts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public void LoadNotoFallbackSettings()
Examples
Shows how to add predefined font fallback settings for Google Noto fonts.
FontSettings fontSettings = new FontSettings();
// These are free fonts licensed under SIL OFL
// They can be downloaded from https://www.google.com/get/noto/#sans-lgc
fontSettings.SetFontsFolder(FontsDir + "Noto", false);
// Note that only Sans style Noto fonts with regular weight are used in the predefined settings
// Some of the Noto fonts uses advanced typography features
// Advanced typography is currently not supported by AW and these fonts may be rendered inaccurately
fontSettings.FallbackSettings.LoadNotoFallbackSettings();
fontSettings.SubstitutionSettings.FontInfoSubstitution.Enabled = false;
fontSettings.SubstitutionSettings.DefaultFontSubstitution.DefaultFontName = "Noto Sans";

Document doc = new Document();
doc.FontSettings = fontSettings;
Examples
Shows how to load pre-defined fallback font settings.
Document doc = new Document();

// Create a FontSettings object for our document and get its FallbackSettings attribute
FontSettings fontSettings = new FontSettings();
doc.FontSettings = fontSettings;
FontFallbackSettings fontFallbackSettings = fontSettings.FallbackSettings;

// Save the default fallback font scheme in an XML document
// For example, one of the elements has a value of "0C00-0C7F" for Range and a corresponding "Vani" value for FallbackFonts
// This means that if the font we are using does not have symbols for the 0x0C00-0x0C7F unicode block,
// the symbols from the "Vani" font will be used as a substitute
fontFallbackSettings.Save(ArtifactsDir + "Font.FallbackSettings.Default.xml");

// There are two pre-defined font fallback schemes we can choose from
// 1: Use the default Microsoft Office scheme, which is the same one as the default
fontFallbackSettings.LoadMsOfficeFallbackSettings();
fontFallbackSettings.Save(ArtifactsDir + "Font.FallbackSettings.LoadMsOfficeFallbackSettings.xml");

// 2: Use the scheme built from Google Noto fonts
fontFallbackSettings.LoadNotoFallbackSettings();
fontFallbackSettings.Save(ArtifactsDir + "Font.FallbackSettings.LoadNotoFallbackSettings.xml");
See Also