Create Fallback Font

Contents
[ ]

Aspose.Slides supports IFontFallBackRule interface and FontFallBackRule class to specify the rules to apply a fallback font. FontFallBackRule class represents an association between the specified Unicode range, used for searching missed glyphs, and a list of fonts that may contain proper glyphs:

uint32_t startUnicodeIndex = 0x0B80;
uint32_t endUnicodeIndex = 0x0BFF;

auto firstRule = MakeObject<FontFallBackRule>(startUnicodeIndex, endUnicodeIndex, u"Vijaya");
auto secondRule = MakeObject<FontFallBackRule>(static_cast<uint32_t>(0x3040), static_cast<uint32_t>(0x309F), u"MS Mincho, MS Gothic");

// Using multiple ways you can add fonts list:
auto fontNames = MakeArray<String>({ u"Segoe UI Emoji, Segoe UI Symbol", u"Arial" });

auto thirdRule = MakeObject<FontFallBackRule>(static_cast<uint32_t>(0x1F300), static_cast<uint32_t>(0x1F64F), fontNames);

It is also possible to Remove() fallback font or AddFallBackFonts() into existing FontFallBackRule object.

FontFallBackRulesCollection can be used to organize a list of FontFallBackRule objects, when there is a need to specify fallback font replacement rules for multiple Unicode ranges.