Custom Fonts Ignored when Converting PPTX to SVG with Aspose.Slides Cloud

I’m having issues getting custom fonts to be recognised when converting slides from PowerPoint presentations to SVG with slides cloud.

I’ve added the fonts into s3 storage and passed through the fontsFolder parameter, but the resulting SVGs have the incorrect fonts applied, and the placement of the text is incorrect due to the wrong fonts being applied during conversion.

I’ve tried using both .otf and .woff2 fonts, I’ve tried different file names, and I’ve tried using the embedFont API to embed fonts into the PowerPoint file before conversion, but nothing seems to be working.

Are there only specific font formats that work, or is there a specific naming convention for files? The documentation doesn’t really specify anything.

Original layout (404.8 KB)
Converted layout (43.5 KB)

@ddsam,
Thank you for contacting support.

To investigate the issue on our end, we need more details. Please share the following files an information:

  • sample presentation file
  • output SVG files
  • code example that reproduces the problem
  • SDK version you used
  • font files you used

You can zip the files and upload an archive here.

Also please note that Aspose.Slides only works with OTF and TTF font files.

Sample files are here:

I’m using the PHP API for aspose cloud, and these files are from the local docker container.

Code is as follows:

$exportOptions = new SvgExportOptions([
    'vectorizeText' => false,
    'deletePicturesCroppedAreas' => true,
    'picturesCompression' => SvgExportOptions::PICTURES_COMPRESSION_DOCUMENT_RESOLUTION,
    'externalFontsHandling' => SvgExportOptions::EXTERNAL_FONTS_HANDLING_EMBED,
]);

$svg = Slides::downloadSlideAsResponse(
    $filename,
    $index,
    SlideExportFormat::SVG,
    $exportOptions,
    folder: 'stream/12345678/presentations',
    fontsFolder: '/fonts/*',
);

I’ll also note that I get the same output no matter which setting I use for externalFontsHandling

@ddsam,
Thank you for the details. I working on the issue and will get back to you soon.

I’ve tried saving the PowerPoint presentation with fonts embedded, but it’s still making no difference. I’ll attempt to convert via PDF first, but I suspect that it will also get the letter positioning wrong if it’s not reading the fonts.

One other issue that I found confusing was that if I set the fontsFolder parameter to fonts, /fonts, fonts/ or /fonts/ it threw an internal server error with an s3 error claiming that the fonts object doesn’t exist. If I set the parameter to a specific font file, or to fonts/* then it didn’t throw an exception. I’ll note that this is all using S3 storage, and locally I’ve been using minio with docker.

@ddsam,
Thank you for your patience.

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-1837

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.

@ddsam,
You have to only specify the folder name (or path, if it is nested like “folder/subfolder”) for the fontsFolder parameter.
To check whether the folder exists, you can use the ObjectExists method
(GET https://api.aspose.cloud/v3.0/slides/storage/exist/{path}).

By the way, what API you are using? Our SDKs do not have the downloadSlideAsResponse methods.
If the issue is not solved, could you please provide the HTTP request that causes the problem?

Oh, sorry, that is my own function/extension to the PHP API to get the Guzzle StreamingResponse object directly instead of writing to disk. I’m running in an AWS lambda environment, and don’t want to have to write the file to disk before streaming it to S3.

The method is this - it uses the internal API functions:

    /**
     * @param string $name
     * @param int $slideIndex
     * @param string $format
     * @param ExportOptions|null $options
     * @param int|null $width
     * @param int|null $height
     * @param string|null $password
     * @param string|null $folder
     * @param string|null $storage
     * @param string|null $fontsFolder
     * @return ResponseInterface
     * @throws ApiException
     * @throws RepeatRequestException
     */
    public function downloadSlideAsResponse(
        string $name,
        int $slideIndex,
        string $format,
        ?ExportOptions $options = null,
        ?int $width = null,
        ?int $height = null,
        ?string $password = null,
        ?string $folder = null,
        ?string $storage = null,
        ?string $fontsFolder = null
    ): ResponseInterface {
        try {
            $httpRequest = $this->downloadSlideRequest(
                $name,
                $slideIndex,
                $format,
                $options,
                $width,
                $height,
                $password,
                $folder,
                $storage,
                $fontsFolder,
            );

            return $this->httpCall($httpRequest);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $e->setResponseObject($e->getResponseBody());
                    break;
                default:
                    $this->handleApiException($e);
            }
            throw $e;
        }
    }

The only things that didn’t throw an exception from the fontsFolder parameter was fonts/* or a direct link to a specific font file - everything else failed, despite the paths existing.

@ddsam,
Thank you for the additional information. I’ve forwarded it to our developers.