FontsManager
Presentation.FontsManager 属性
返回字体管理器。只读 IFontsManager
。
public IFontsManager FontsManager { get; }
示例
以下示例演示如何将嵌入字体添加到 PowerPoint 演示文稿中。
[C#]
// 加载演示文稿
using (Presentation presentation = new Presentation("Fonts.pptx"))
{
// 加载要替换的源字体
IFontData sourceFont = new FontData("Arial");
IFontData[] allFonts = presentation.FontsManager.GetFonts();
IFontData[] embeddedFonts = presentation.FontsManager.GetEmbeddedFonts();
foreach (IFontData font in allFonts)
{
if (!embeddedFonts.Contains(font))
{
presentation.FontsManager.AddEmbeddedFont(font, EmbedFontCharacters.All);
}
}
// 保存演示文稿
presentation.Save("AddEmbeddedFont_out.pptx", SaveFormat.Pptx);
}
另请参见
- 接口 IFontsManager
- 类 Presentation
- 命名空间 Aspose.Slides
- 程序集 Aspose.Slides