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.

I have the same problem, which still seems to happen.

https://api.aspose.cloud/v3.0/slides/fonts/available?fontsFolder=fonts&storage=mystorage)

Response:

{
  "list": [
    {
      "fontName": "Arial"
    },
    {
      "fontName": "Arial Black"
    },
    {
      "fontName": "Bahnschrift"
    },
    {
      "fontName": "Bahnschrift Condensed"
    },
    {
      "fontName": "Bahnschrift Light"
    },
    {
      "fontName": "Bahnschrift Light Condensed"
    },
    {
      "fontName": "Bahnschrift Light SemiCondensed"
    },
    {
      "fontName": "Bahnschrift SemiBold"
    },
    {
      "fontName": "Bahnschrift SemiBold Condensed"
    },
    {
      "fontName": "Bahnschrift SemiBold SemiConden"
    },
    {
      "fontName": "Bahnschrift SemiCondensed"
    },
    {
      "fontName": "Bahnschrift SemiLight"
    },
    {
      "fontName": "Bahnschrift SemiLight Condensed"
    },
    {
      "fontName": "Bahnschrift SemiLight SemiConde"
    },
    {
      "fontName": "Calibri"
    },
    {
      "fontName": "Calibri Light"
    },
    {
      "fontName": "Cambria"
    },
    {
      "fontName": "Cambria Math"
    },
    {
      "fontName": "Candara"
    },
    {
      "fontName": "Candara Light"
    },
    {
      "fontName": "Comic Sans MS"
    },
    {
      "fontName": "Consolas"
    },
    {
      "fontName": "Constantia"
    },
    {
      "fontName": "Corbel"
    },
    {
      "fontName": "Corbel Light"
    },
    {
      "fontName": "Courier New"
    },
    {
      "fontName": "Ebrima"
    },
    {
      "fontName": "Franklin Gothic Medium"
    },
    {
      "fontName": "Gabriola"
    },
    {
      "fontName": "Gadugi"
    },
    {
      "fontName": "Georgia"
    },
    {
      "fontName": "Impact"
    },
    {
      "fontName": "Ink Free"
    },
    {
      "fontName": "Javanese Text"
    },
    {
      "fontName": "Leelawadee UI"
    },
    {
      "fontName": "Leelawadee UI Semilight"
    },
    {
      "fontName": "Lucida Console"
    },
    {
      "fontName": "Lucida Sans Unicode"
    },
    {
      "fontName": "Malgun Gothic"
    },
    {
      "fontName": "Malgun Gothic Semilight"
    },
    {
      "fontName": "Marlett"
    },
    {
      "fontName": "Microsoft Himalaya"
    },
    {
      "fontName": "Microsoft JhengHei"
    },
    {
      "fontName": "Microsoft JhengHei Light"
    },
    {
      "fontName": "Microsoft JhengHei UI"
    },
    {
      "fontName": "Microsoft JhengHei UI Light"
    },
    {
      "fontName": "Microsoft New Tai Lue"
    },
    {
      "fontName": "Microsoft PhagsPa"
    },
    {
      "fontName": "Microsoft Sans Serif"
    },
    {
      "fontName": "Microsoft Tai Le"
    },
    {
      "fontName": "Microsoft YaHei"
    },
    {
      "fontName": "Microsoft YaHei Light"
    },
    {
      "fontName": "Microsoft YaHei UI"
    },
    {
      "fontName": "Microsoft YaHei UI Light"
    },
    {
      "fontName": "Microsoft Yi Baiti"
    },
    {
      "fontName": "MingLiU-ExtB"
    },
    {
      "fontName": "MingLiU_HKSCS-ExtB"
    },
    {
      "fontName": "Mongolian Baiti"
    },
    {
      "fontName": "MS Gothic"
    },
    {
      "fontName": "MS PGothic"
    },
    {
      "fontName": "MS UI Gothic"
    },
    {
      "fontName": "MV Boli"
    },
    {
      "fontName": "Myanmar Text"
    },
    {
      "fontName": "Nirmala UI"
    },
    {
      "fontName": "Nirmala UI Semilight"
    },
    {
      "fontName": "NSimSun"
    },
    {
      "fontName": "Palatino Linotype"
    },
    {
      "fontName": "PMingLiU-ExtB"
    },
    {
      "fontName": "Segoe MDL2 Assets"
    },
    {
      "fontName": "Segoe Print"
    },
    {
      "fontName": "Segoe Script"
    },
    {
      "fontName": "Segoe UI"
    },
    {
      "fontName": "Segoe UI Black"
    },
    {
      "fontName": "Segoe UI Emoji"
    },
    {
      "fontName": "Segoe UI Historic"
    },
    {
      "fontName": "Segoe UI Light"
    },
    {
      "fontName": "Segoe UI Semibold"
    },
    {
      "fontName": "Segoe UI Semilight"
    },
    {
      "fontName": "Segoe UI Symbol"
    },
    {
      "fontName": "SimSun"
    },
    {
      "fontName": "SimSun-ExtB"
    },
    {
      "fontName": "Sitka Banner"
    },
    {
      "fontName": "Sitka Display"
    },
    {
      "fontName": "Sitka Heading"
    },
    {
      "fontName": "Sitka Small"
    },
    {
      "fontName": "Sitka Subheading"
    },
    {
      "fontName": "Sitka Text"
    },
    {
      "fontName": "Sylfaen"
    },
    {
      "fontName": "Symbol"
    },
    {
      "fontName": "Tahoma"
    },
    {
      "fontName": "Times New Roman"
    },
    {
      "fontName": "Trebuchet MS"
    },
    {
      "fontName": "Verdana"
    },
    {
      "fontName": "Webdings"
    },
    {
      "fontName": "Wingdings"
    },
    {
      "fontName": "Yu Gothic"
    },
    {
      "fontName": "Yu Gothic Light"
    },
    {
      "fontName": "Yu Gothic Medium"
    },
    {
      "fontName": "Yu Gothic UI"
    },
    {
      "fontName": "Yu Gothic UI Light"
    },
    {
      "fontName": "Yu Gothic UI Semibold"
    },
    {
      "fontName": "Yu Gothic UI Semilight"
    }
  ]
}

These are not the fonts from the fonts folder, but something else. It’s not the font list of my local system. Hence, I guess, it’s the font list of the Aspose cloud system.

Asking for the fonts used by the presentation:

https://api.aspose.cloud/v3.0/slides/my.pptx/fonts?folder=myfolder&storage=mystorage)

I get the correct answer:

{
  "list": [
    {
      "fontName": "Arial"
    },
    {
      "fontName": "Symbol"
    },
    {
      "fontName": "Aptos Display"
    },
    {
      "fontName": "Aptos"
    },
    {
      "fontName": "Poppins"
    },
    {
      "fontName": "Calibri"
    },
    {
      "fontName": "Wingdings"
    }
  ]
}

@saphirion,
Thank you for the message. I’ve forwarded your information to our developers.

@saphirion,
This method
https://api.aspose.cloud/v3.0/slides/fonts/available?fontsFolder=fonts&storage=mystorage
returns all available fonts: the system fonts on the cloud server plus any fonts in the specified fontsFolder. To distinguish built-in fonts from custom ones, check the IsCustom property. For example, according to the returned JSON, there are no custom fonts in the fonts folder on mystorage.

This method isn’t tied to a specific presentation; it simply reports which fonts are installed on the server.

The following method
https://api.aspose.cloud/v3.0/slides/my.pptx/fonts?folder=myfolder&storage=mystorage
returns the fonts used in my.pptx.

Please let me know if anything remains unclear.

As mentioned the content of the fonts folder in my storage linked to Google Drive isn’t taking into account. This is what should be included:

Poppins-Black.ttf
Poppins-BlackItalic.ttf
Poppins-Bold.ttf
Poppins-BoldItalic.ttf
Poppins-ExtraBold.ttf
Poppins-ExtraBoldItalic.ttf
Poppins-ExtraLight.ttf
Poppins-ExtraLightItalic.ttf
Poppins-Italic.ttf
Poppins-Light.ttf
Poppins-LightItalic.ttf
Poppins-Medium.ttf
Poppins-MediumItalic.ttf
Poppins-Regular.ttf
Poppins-SemiBold.ttf
Poppins-SemiBoldItalic.ttf
Poppins-Thin.ttf
Poppins-ThinItalic.ttf
Lobster.ttf
Play-Bold.ttf
Play-Regular.ttf

@saphirion,
Thank you for the information. I’ve forwarded your information to our developers.