Set a Default Font for All Slides in a PowerPoint Presentation in C#

Hi Team,

When we insert a text box in any of the slides after generated form aspose, the default font that is getting displayed is ‘Calibri’ – Can this be changed to ‘Arial’ – by setting Default Font in all slides generated from aspose.

Thanks,

@Rashique,
Thank you for contacting support.

To change the default font for text boxes generated by Aspose.Slides, you can apply the font to the presentation theme like this:

presentation.MasterTheme.FontScheme.Major.LatinFont = new FontData("Arial");
presentation.MasterTheme.FontScheme.Minor.LatinFont = new FontData("Arial");

More examples:

Thanks @andrey.potapov
I tried the method that you suggested but still, the default font is Calibri when I try to insert a textbox in any of the slides in the ppt generating from aspose.

@Rashique,
Please check your results using the latest version of Aspose.Slides for .NET if possible. If the issue persists, please share the following files and information:

  • input presentation file (if you used it)
  • complete code example that reproduces the problem
  • output presentation file
  • OS version on which the code was executed
  • .NET target platform in your app
  • Aspose.Slides version you used

Please find the below details and the zip file for more details,

Desktop.zip (40.0 KB)

  • .NET target platform: .Net 5.0
  • Aspose.Slides version: Aspose.Slides.Net (23.1.0)

@Rashique,
Thank you for the additional information. I will get back to you soon.

@Rashique,
Unfortunately, your code example does not reproduce the problem and it does not contain the code lines I provided. Please check your code and issue.

Thanks its working fine now
We need one more clarification for changing the default font size for text boxes as size 10 instead of 18.

@Rashique,
We are glad to know that the issue has been resolved on your end. As for changing the default font size for text boxes, I answered you here.