GetFontBytes()

FontsManager::GetFontBytes(System::SharedPtr<Aspose::Slides::IFontData>, System::Drawing::FontStyle) method

Retrieves the byte array representing the font data for a specified font style and font data.

System::ArrayPtr<uint8_t> Aspose::Slides::FontsManager::GetFontBytes(System::SharedPtr<Aspose::Slides::IFontData> fontData, System::Drawing::FontStyle fontStyle) override

Arguments

ParameterTypeDescription
fontDataSystem::SharedPtr<Aspose::Slides::IFontData>The font data object containing the information about the font FontData.
fontStyleSystem::Drawing::FontStyleThe style of the font for which the data is to be retrieved FontStyle.

Return Value

A byte array containing the font data for the specified font style. If the font data or style is not found, returns null.

Remarks

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(u"Presentation.pptx");

// Retrieve all fonts used in the presentation
System::ArrayPtr<System::SharedPtr<IFontData>> fonts = pres->get_FontsManager()->GetFonts();

// Get the byte array representing the regular style of the first font in the presentation
System::ArrayPtr<uint8_t> bytes = pres->get_FontsManager()->GetFontBytes(fonts[0], System::Drawing::FontStyle::Regular);

See Also