Create Fallback Fonts Collection
Instances of FontFallBackRule class can be organized into FontFallBackRulesCollection, that implements IFontFallBackRulesCollection interface. It is possible to add or remove rules from the collection.
Then this collection may be assigned to FontFallBackRulesCollection method of the FontsManager class. FontsManager controls fonts across the presentation. Read more About FontsManager and FontsLoader.
Each Presentation has a getFontsManager method with its own instance of the FontsManager class.
Here is an examples how to create fallback fonts rules collection and assign in into the FontsManager of a certain presentation:
$pres = new Presentation();
try {
$userRulesList = new FontFallBackRulesCollection();
$userRulesList->add(new FontFallBackRule(0xb80, 0xbff, "Vijaya"));
$userRulesList->add(new FontFallBackRule(0x3040, 0x309f, "MS Mincho, MS Gothic"));
$pres->getFontsManager()->setFontFallBackRulesCollection($userRulesList);
} finally {
if (!java_is_null($pres)) {
$pres->dispose();
}
}
After FontsManager is initialised with fallback fonts collection, the fallback fonts are applied during presentation rendering.