GetFontBytes()

IFontsManager::GetFontBytes(System::SharedPtr<IFontData>, System::Drawing::FontStyle) method

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

virtual System::ArrayPtr<uint8_t> Aspose::Slides::IFontsManager::GetFontBytes(System::SharedPtr<IFontData> fontData, System::Drawing::FontStyle fontStyle)=0

Arguments

ParameterTypeDescription
fontDataSystem::SharedPtr<IFontData>The font data object containing the information about the font IFontData.
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

Deprecated
Use GetFontBytes(IFontData fontData, FontStyleType fontStyle) method instead. This method will be removed after release of version 25.10.
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);

IFontsManager::GetFontBytes(System::SharedPtr<IFontData>, FontStyleType) method

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

virtual System::ArrayPtr<uint8_t> Aspose::Slides::IFontsManager::GetFontBytes(System::SharedPtr<IFontData> fontData, FontStyleType fontStyle)=0

Arguments

ParameterTypeDescription
fontDataSystem::SharedPtr<IFontData>The font data object containing the information about the font IFontData.
fontStyleFontStyleTypeThe style of the font for which the data is to be retrieved FontStyleType.

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], FontStyleType::Regular);

See Also