Aspose::Words::Saving::PclSaveOptions::set_FallbackFontName method

PclSaveOptions::set_FallbackFontName method

Name of the font that will be used if no expected font is found in printer and built-in fonts collections.

void Aspose::Words::Saving::PclSaveOptions::set_FallbackFontName(const System::String & value)

Remarks

If no fallback is found, a warning is generated and “Arial” font is used.

Examples

Shows how to declare a font that a printer will apply to printed text as a substitute should its original font be unavailable.

auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);

builder->get_Font()->set_Name(u"Non-existent font");
builder->Write(u"Hello world!");

auto saveOptions = System::MakeObject<Aspose::Words::Saving::PclSaveOptions>();
saveOptions->set_FallbackFontName(u"Times New Roman");

// This document will instruct the printer to apply "Times New Roman" to the text with the missing font.
// Should "Times New Roman" also be unavailable, the printer will default to the "Arial" font.
doc->Save(get_ArtifactsDir() + u"PclSaveOptions.SetPrinterFont.pcl", saveOptions);

See Also