GetFontEmbeddingLevel

IFontsManager.GetFontEmbeddingLevel 方法

根据给定的字节数组和字体名称确定字体的嵌入级别。

public EmbeddingLevel GetFontEmbeddingLevel(byte[] fontBytes, string fontName)
参数类型描述
fontBytesByte[]包含字体数据的字节数组。
fontNameString字体名称。

返回值

指定字体的嵌入级别。

异常

异常条件
ArgumentNullExceptionfontBytes 为 null 时抛出。

示例

[C#]
using (Presentation pres = new Presentation(pptxFileName))
{
    // 检索演示文稿中使用的所有字体
    IFontData[] fontDatas = pres.FontsManager.GetFonts();

    // 获取表示演示文稿中第一个字体常规样式的字节数组
    byte[] bytes = pres.FontsManager.GetFontBytes(fontDatas[0], FontStyle.Regular);

    // 确定字体的嵌入级别
    EmbeddingLevel embeddingLevel = pres.FontsManager.GetFontEmbeddingLevel(bytes, fontDatas[0].FontName);
}

另请参阅