Aspose::Words::Fonts::FontInfoCollection::get_SaveSubsetFonts method

FontInfoCollection::get_SaveSubsetFonts method

Specifies whether or not to save a subset of the embedded TrueType fonts with the document. Default value for this property is false. This option works only when EmbedTrueTypeFonts property is set to true.

bool Aspose::Words::Fonts::FontInfoCollection::get_SaveSubsetFonts() const

Examples

Shows how to save a document with embedded TrueType fonts.

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

SharedPtr<Aspose::Words::Fonts::FontInfoCollection> fontInfos = doc->get_FontInfos();
fontInfos->set_EmbedTrueTypeFonts(embedAllFonts);
fontInfos->set_EmbedSystemFonts(embedAllFonts);
fontInfos->set_SaveSubsetFonts(embedAllFonts);

doc->Save(ArtifactsDir + u"Font.FontInfoCollection.docx");

if (embedAllFonts)
{
    ASSERT_LT(25000, MakeObject<System::IO::FileInfo>(ArtifactsDir + u"Font.FontInfoCollection.docx")->get_Length());
}
else
{
    ASSERT_GE(15000, MakeObject<System::IO::FileInfo>(ArtifactsDir + u"Font.FontInfoCollection.docx")->get_Length());
}

See Also