Set Fallback font for all Latin characters

Hi,
We use Aspose.Cells to convert excel files to PDF, some of this files have custom fonts, that are not presented in a system so we load them as memory fonts.

Here is the code that we use to load them:

var tenantFonts = await LoadFonts(); // downloads ttf files from the storage 
var memoryFontSources = tenantFonts.Select(f => new MemoryFontSource(f)).Cast<FontSourceBase>().ToArray();
var individualFontConfigs = new IndividualFontConfigs();
individualFontConfigs.SetFontSources(memoryFontSources);
var workbook = new Workbook(sourceStream,
                                new LoadOptions()
                                {
                                    FontConfigs = individualFontConfigs,
                                });
    await using var outputStream = new MemoryStream();
    workbook.Save(outputStream, SaveFormat.Pdf);

Is there a way to set a fallback font in this case? The only available API seems to be:

individualFontConfigs.SetFontSubstitutes

But it seems that it’s only possible to do on a font basis. Can we set a fallback for all Latin characters for example? Or a fallback for all Asian characters? Like in Aspose.Words for example.

@arst,

Could you please elaborate your requirements a bit. Also, share sample Excel file and expected output PDF. Moreover, share examples and sample scenario/use case on what Aspose.Words can implement it. We will then evaluate if we could implement the same thing in Aspose.Cells.

1 Like