We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Font Error on Linux Alpine Using Calibri Font

When using FontFolders and the Calibri font is in one of those folders we are getting a error on save. Using any pptx originally created in PowerPoint.

Font ‘?’ cannot be found.
at System.Drawing.FontFamily.GetCellAscent(FontStyle style)
at .(Font , Single& , Single& , Single& )
at .(String , , , Boolean , Int32 , Single& , Single& )
at .( , , , , Int32 , Single& , Single& , Single& )
at .() at …ctor(TextFrame , Single , Single , IBaseSlide , )
at Aspose.Slides.TextFrame.(Single , Single , IShapeStyle , )
at Aspose.Slides.TextFrame.(ShapeFrame& , RectangleF& , Single& , Single& , Single& , Single& , )
at .(IAutoShape , , , )
at .(IGroupShape , , , )
at .(IBaseSlide , , )
at .(IMasterSlide , Boolean )
at .( , IMasterSlide , Boolean , )
at .(IPresentation , Stream , PresentationTypeEx , IPptxOptions , InterruptionToken )
at Aspose.Slides.Presentation.(Stream , PresentationTypeEx , IPptxOptions )
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)

If Calibri is not in the folder there is no error.
If Ubuntu is used instead of Alpine there is no error.
No error from Aspose.Words or Aspose.Cells with a similar test.
Application is a ASP.NET site using .NET Core v3.1.

Load code
var opts = new Aspose.Slides.LoadOptions();

        opts.DocumentLevelFontSources.FontFolders = new string[] { "{local folder}" };

        return new Aspose.Slides.Presentation(
            documentStream,
            opts);

Save code
using var ms = new MemoryStream();
document.Save(ms, SaveFormat.Pptx);

Docker
FROM mcr.microsoft.com/dotnet/aspnet:3.1-alpine
WORKDIR /app
COPY Product .

#default environment variables
ENV Logging__LogLevel__Default=Warning
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

RUN apk update
RUN apk --no-cache add icu-libs msttcorefonts-installer fontconfig harfbuzz-dev tzdata &&
update-ms-fonts &&
fc-cache -f
RUN apk --no-cache add libgdiplus --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted

ENTRYPOINT [“dotnet”, “Product.dll”]

@bruceb6,
Thank you for the issue description. Could you please specify the version of Aspose.Slides you used?

I’ve tried with 21.8.0 and 21.11.0.
I also just tried with a .NET 6 image and application with the same result.

Thanks

@bruceb6,
Thank you for the additional information.

I logged the issue with ID SLIDESNET-42911 in our tracking system. Our development team will investigate this case. We will inform you of any progress.