Javaでフォールバックフォントコレクションを構成する

フォールバック ルールの適用

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.

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:

Presentation pres = new Presentation();
try {
    IFontFallBackRulesCollection userRulesList = new FontFallBackRulesCollection();

    userRulesList.add(new FontFallBackRule(0x0B80, 0x0BFF, "Vijaya"));
    userRulesList.add(new FontFallBackRule(0x3040, 0x309F, "MS Mincho, MS Gothic"));

    pres.getFontsManager().setFontFallBackRulesCollection(userRulesList);
} finally {
    if (pres != null) pres.dispose();
}

After FontsManager is initialised with fallback fonts collection, the fallback fonts are applied during presentation rendering.

よくある質問

フォールバック ルールは PPTX ファイルに埋め込まれ、保存後に PowerPoint で表示されますか?

いいえ。フォールバック ルールは実行時のレンダリング設定であり、PPTX にシリアライズされず、PowerPoint の UI には表示されません。

フォールバックは SmartArt、WordArt、チャート、テーブル内のテキストにも適用されますか?

はい。これらのオブジェクト内のテキストすべてに同じグリフ置換メカニズムが使用されます。

Aspose はライブラリにフォントを同梱していますか?

いいえ。フォントはご自身で追加・使用していただき、その責任はご自身にあります。

欠落フォントの置換/サブスティテューションと、欠落グリフに対するフォールバックは同時に使用できますか?

はい。これは同じフォント解決パイプラインの独立した段階です。まずエンジンがフォントの利用可能性を解決し(replacement/substitution)、次にフォールバックが利用可能なフォント内の欠落グリフのギャップを埋めます。