Aspose::Words::Fonts::FontFallbackSettings::Load method

FontFallbackSettings::Load(const System::SharedPtr<System::IO::Stream>&) method

Loads fallback settings from XML stream.

void Aspose::Words::Fonts::FontFallbackSettings::Load(const System::SharedPtr<System::IO::Stream> &stream)
ParameterTypeDescription
streamconst System::SharedPtr<System::IO::Stream>&Input stream.

Examples

Shows how to load and save font fallback settings to/from a stream.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");

// Load an XML document that defines a set of font fallback settings.
{
    auto fontFallbackStream = MakeObject<System::IO::FileStream>(MyDir + u"Font fallback rules.xml", System::IO::FileMode::Open);
    auto fontSettings = MakeObject<FontSettings>();
    fontSettings->get_FallbackSettings()->Load(fontFallbackStream);

    doc->set_FontSettings(fontSettings);
}

doc->Save(ArtifactsDir + u"FontSettings.LoadFontFallbackSettingsFromStream.pdf");

// Use a stream to save our document's current font fallback settings as an XML document.
{
    auto fontFallbackStream = MakeObject<System::IO::FileStream>(ArtifactsDir + u"FallbackSettings.xml", System::IO::FileMode::Create);
    doc->get_FontSettings()->get_FallbackSettings()->Save(fontFallbackStream);
}

See Also

FontFallbackSettings::Load(const System::String&) method

Loads font fallback settings from XML file.

void Aspose::Words::Fonts::FontFallbackSettings::Load(const System::String &fileName)
ParameterTypeDescription
fileNameconst System::String&Input file name.

Examples

Shows how to load and save font fallback settings to/from an XML document in the local file system.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");

// Load an XML document that defines a set of font fallback settings.
auto fontSettings = MakeObject<FontSettings>();
fontSettings->get_FallbackSettings()->Load(MyDir + u"Font fallback rules.xml");

doc->set_FontSettings(fontSettings);
doc->Save(ArtifactsDir + u"FontSettings.LoadFontFallbackSettingsFromFile.pdf");

// Save our document's current font fallback settings as an XML document.
doc->get_FontSettings()->get_FallbackSettings()->Save(ArtifactsDir + u"FallbackSettings.xml");

See Also

FontFallbackSettings::Load(std::basic_istream<CharType, Traits>&) method

template<typename CharType,typename Traits> void Aspose::Words::Fonts::FontFallbackSettings::Load(std::basic_istream<CharType, Traits> &stream)

See Also