Hello @andrey.potapov , currently I am also facing the same issue. Arial fonts in my slides are getting replaced by another font which is bold. Calibri fonts also don’t seem to work as intended. Can you please confirm whether there is an issue with these fonts or what is happening? I saw in another thread that the another user had mentioned that he saw in his logs:
Font “Arial” will be substituted with “Arimo”
Font “Calibri” will be substituted with “Cantarell”
Why are server fonts getting replaced by other fonts?
@softwarets,
Thank you for contacting free support. Unfortunately, I was unable to reproduce the problem you encountered using the API Reference. Could you please share step-by-step instructions, the necessary files, and a code example to reproduce the font substitution in your case?
Hey @andrey.potapov , we are using Aspose slides cloud for PPT to PNG conversion.
Here are the necessary details:
PPT file with the text in Arial fonts:
Slide font issue.zip (2.7 MB)
We are using asposeslidescloud
python library (version 24.12.0)
Here is a code snippet you can use to replicate the issue:
import asposeslidescloud
from asposeslidescloud.models.image_export_options import ImageExportOptions
from asposeslidescloud.models.export_format import ExportFormat
import os, shutil
from pptx import Presentation
CLIENT_ID = os.getenv("CLIENT_ID")
CLIENT_SECRET = os.getenv("CLIENT_SECRET")
def calculate_aspect_fit(original_width, original_height, target_width, target_height):
"""
Calculates the new dimensions to fit an original size into a target bounding box
while preserving the original aspect ratio.
:param original_width: Width of the original image/slide.
:param original_height: Height of the original image/slide.
:param target_width: The maximum width of the output image.
:param target_height: The maximum height of the output image.
:return: A tuple of (new_width, new_height) as integers.
"""
original_ratio = original_width / original_height
target_ratio = target_width / target_height
if original_ratio > target_ratio:
# Original is wider than the target box, so the new width is the target width
new_width = target_width
new_height = new_width / original_ratio
else:
# Original is taller than or equal to the target box, so the new height is the target height
new_height = target_height
new_width = new_height * original_ratio
return int(round(new_width)), int(round(new_height))
# initialize Aspose.Slides Cloud instance.
configuration = asposeslidescloud.Configuration()
configuration.app_sid = CLIENT_ID
configuration.app_key = CLIENT_SECRET
slidesApi = asposeslidescloud.SlidesApi(configuration)
# load PPT file from local drive into Stream instance
fileName = "presentation.pptx"
presentation = Presentation(fileName)
print(f"Number of slides in presentation: {len(presentation.slides)}")
num_pptx_slides = len(presentation.slides)
width = presentation.slide_width
height = presentation.slide_height
print(f"Slide dimensions are : width = {width}, height = {height}")
# Calculate new dimensions to fit the slide into a 1280x720 box
new_width, new_height = calculate_aspect_fit(width, height, 1280, 720)
print(f"New dimensions such that the slides fit into the canvas are: width = {new_width}, height = {new_height}")
with open(fileName, 'rb') as f:
file = f.read()
options = ImageExportOptions()
options.width = new_width
options.height = new_height
options.show_hidden_slides = True
thread = slidesApi.convert(file, format=ExportFormat.PNG, options=options, fonts_folder="custom_fonts", is_async=True)
path = thread.get()
print(f"File converted to {path}")
Here is the result we are getting for this:
Result.zip (1.3 MB)
As you can see in the results, all the Arial fonts are getting converted into Arial bold. Please let me at the earliest what the issue is.
@softwarets,
Thank you for the details. I have reproduced the problem with the Arial font when converting the presentation slides to PNG images. We apologize for any inconvenience caused.
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): SLIDESCLOUD-2071
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.
The Calibri font looks fine when converting slide 3 to a PNG image (your Result.zip/Slide03.png). Could you please explain how to reproduce the issue with the Calibri font?
@andrey.potapov Can you tell me the solution for Arial fonts. Something that I can tell our customers such that Arial fonts come out correctly? We have asked our clients not to use Calibri because the issues were more frequent with Calibri font.
@softwarets,
Unfortunately, I cannot provide a solution at the moment. We need some time to investigate this case.