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

Free Support Forum - aspose.com

Font is not used in image rendering even if the font is already installed

Hi,

I have an Excel worksheet using the font ‘Source Sans Pro’, but when I converted the worksheet to image, the font became ‘Arial’.

Code:
var workbook = new Workbook(@".\test.xlsx");
var options = new ImageOrPrintOptions
{
ImageType = ImageType.Emf,
OnlyArea = false, // copy as picture - as shown when printed
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
OnePagePerSheet = true,
Transparent = true
};
workbook.Worksheets[0].PageSetup.PrintArea =@“A1:F9”;
new SheetRender(workbook.Worksheets[0], options).ToImage(0, @".\out.emf");

I have double-checked the font installed, and they were in my pc.

I have attached the test file and a screenshot for your reference:
test.zip (14.1 KB)
image.png (62.1 KB)

The font ‘Source Sans Pro’ can be found in https://www.fontsquirrel.com/fonts/source-sans-pro if you don’t already have it on your test machine.

Could you help me check if there’s an issue in Aspose that cannot pick up this font?

Thanks,

I found in an old ticket that Aspose.Cells rendering did not support OTF font. Could you confirm if it is still the case?

@ServerSide527,
Yes, you are right, OTF font is not supported yet. This ticket is still not resolved and there is no plan in the near future. I am linking this ticket with this thread so you will be notified automatically once any feedback is available about its implementation.

The issues you have found earlier (filed as CELLSNET-43975) have been fixed in Aspose.Cells for .NET v20.8. This message was posted using Bugs notification tool by Amjad_Sahi