GetFontEmbeddingLevel

FontsManager.GetFontEmbeddingLevel method

Determines the embedding level of a font from the given byte array and font name.

public EmbeddingLevel GetFontEmbeddingLevel(byte[] fontBytes, string fontName)
ParameterTypeDescription
fontBytesByte[]The byte array containing the font data.
fontNameStringThe name of the font.

Return Value

The embedding level of the specified font.

Exceptions

exceptioncondition
ArgumentNullExceptionThrown when fontBytes is null.

Examples

[C#]
using (Presentation pres = new Presentation(pptxFileName))
{
    // Retrieve all fonts used in the presentation
    IFontData[] fontDatas = pres.FontsManager.GetFonts();

    // Get the byte array representing the regular style of the first font in the presentation
    byte[] bytes = pres.FontsManager.GetFontBytes(fontDatas[0], FontStyle.Regular);

    // Determine the embedding level of the font
    EmbeddingLevel embeddingLevel = pres.FontsManager.GetFontEmbeddingLevel(bytes, fontDatas[0].FontName);
}

See Also