Custom Fonts Are Not Working when Using Aspose.Slides for Python

I am using aspose slides python library, i have bunch of custom fonts loaded in the fonts folder and when i try to load and convert a sample pptx to pdf, i get the pdf generated with no text! When i comment the line where i load the custom font and then run the conversion I get pdf with text on it. What am i doing wrong ? Below is the code:

def ppt_handler(binary_data):
    start_time = time.time()
    
    try:
        # Generate unique temporary file names using UUID
        input_file_temp_location = f"/tmp/{uuid.uuid4()}.pptx"
        output_file_temp_location = f"/tmp/{uuid.uuid4()}.pdf"
        
        # Write the binary data to a temporary location
        with open(input_file_temp_location, 'wb') as temp_file:
            temp_file.write(binary_data)
        
        # Initialize Aspose.Slides
        license = slides.License()
        license_path = os.path.join(os.path.dirname(__file__), 'license/aspose.lic')
        license.set_license(license_path)

        # Set up font settings
        curr_folder = os.path.dirname(__file__).split('/')
        curr_folder.pop()
        curr_folder.pop()
        fonts_folder = os.path.join('/'.join(curr_folder), 'fonts/')  
        slides.FontsLoader.clear_cache()
       #If i comment the below line it works
        slides.FontsLoader.load_external_fonts([fonts_folder])
 
        loadOptions = slides.LoadOptions()
        loadOptions.default_regular_font = "Arial"
        loadOptions.default_asian_font = "Arial"        

        # Load the PPT/PPTX document
        presentation = slides.Presentation(input_file_temp_location, loadOptions)

        # Save the presentation as PDF
        presentation.save(output_file_temp_location, slides.export.SaveFormat.PDF)
        
        # Read the PDF file and encode it in base64
        with open(output_file_temp_location, 'rb') as pdf_file:
            encoded_pdf = base64.b64encode(pdf_file.read()).decode('utf-8')
        
        
        execution_time = time.time() - start_time
        slides.FontsLoader.clear_cache()
        LogUtil.info(f"Lambda execution time: {execution_time} seconds")
        
        # Clean up temporary files
        os.remove(input_file_temp_location)
        os.remove(output_file_temp_location)

@amdixit01,
Thank you for contacting support.

We are sorry that you had to encounter this problem. We need more details to investigate the case and help you. Please share the following files and information:

  • input presentation file and output PDF file (you can zip the files and upload an archive here)
  • OS version on which the conversion was performed
  • Python version you used
  • Aspose.Slides version you used

Name: Aspose.Slides
Version: 24.6.0

Operating system: Macbook pro 14.5 (23F79)
Python 3.11
Archive.zip (2.2 MB)

@amdixit01,
Thank you for the additional information. I am working on the issue and will get back to you soon.

@amdixit01,

Could you kindly also share the custom fonts you used?

My fonts folders is too big to be uploaded here. The same folder however works for the words library.

@amdixit01,
Could you please share a link to the font files saved in Google Drive, Dropbox or other file storage?

@amdixit01,
Thank you for the font files. I am working on the issue and will get back to you soon.

@amdixit01,
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESPYNET-222

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@amdixit01,
Unfortunately, our developers were unable to reproduce the bug yet. Please indicate the versions of libraries installed on your macOS system:

  • libgdiplus
  • freetype2
  • fontconfig

This can be done using the following script: python3 get_libraries_info.py.
get_libraries_info.zip (749 Bytes)
Please show us the output of this script.

Please also indicate the source of the package installation. Is it Homebrew, MacPorts, manual build etc.?