Free Support Forum - aspose.com

Where to place fonts for .NET Core in Ubuntu (C# .NET Core)

I have put the fonts on the the usr share folder and used fc-cache but doesn’t seem to work.

@ashiramin,

I have observed your question and like to share that Fonts folder detected by OS, in case of Ubuntu we may use “/usr/share/fonts”, but configuration defined in “/etc/fonts/fonts.conf”, “~/.fonts.conf” or “~/.config/fontconfig/fonts.conf” have a priority.

Also, our API provide support to load the fonts from custom folder as well. You need to copy the fonts from custom directory and load that using API in your application.

FontsLoader.LoadExternalFonts(new string[] { "path1", "path2", ... });
try
{
    using (Presentation input = new Presentation("pres.pptx"))
    {
        ...
    }
}
finally
{
    FontsLoader.ClearCache();
}

Hi I have tried both options and its still not working as desired. I’m attaching the codepptxautomation.zip (2.2 MB)

Here are the attached ppt and pdf the pdf file clearly shows that the Roboto font is not being used correctly by AsposeArchive.zip (48.4 KB)

@ashiramin,

I have observed the sample code shared. In your application you are giving relative path to fonts directory. In my suggestion, please first try making a simple console based application and give an absolute complete path to fonts directory and then load the fonts in your application. Setting relative path for font directory will not work for external fonts loading.

Hi Mudassir,

I’m using the absolute path see code below

FontsLoader.LoadExternalFonts(new string[] { “/App_Data”,

        });

@ashiramin,

I have observed your comments and we have created an issue with ID SLIDESNET-41812 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

The issues you have found earlier (filed as SLIDESNET-41812) have been fixed in this update.