Aspose image rendering ignores Asian fonts in textbox with cell reference

Hi,


When converting an Excel sheet which contains a textbox with cell reference. The output image ignores the Asian font set in the textbox.

Code:
var workbook = new Workbook(@“test.xlsx”);
var options = new ImageOrPrintOptions
{
ImageFormat = ImageFormat.Emf,
OnlyArea = false,
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
OnePagePerSheet = true,
};
new SheetRender(workbook.Worksheets[0], options).ToImage(0, @“test.emf”);

I’ve attached the test files and a screenshot for your reference. You can find the Asian text in first textbox was rendered in wrong font. Could you please have a look into this?

Thanks

Hi,


Thanks for the template files and sample code with screenshot.

After an initial test, I noticed the issue as you mentioned by using your template file and sample code. I found that Sheet to Image rendering ignores Asian fonts set in the TextBox with cell reference. The Asian text in first TextBox was rendered in wrong font. I have logged a ticket with an id “CELLSNET-45415” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

Thank you.

Hi,


We think this is not an error. Even in MS Excel, the text does not get changed with the contents of the cell. And we added an attachment for the issue for your reference.

Thank you.

Hi,


Your screenshot is an expected behaviour. Cell reference in a textbox only references the content in the cell but will use the font settings from the textbox itself.

As Excel cell doesn’t support Asian&Latin fonts (the dialog in my initial screenshot) we usually use textbox with font setting + reference to cell content to achieve the Asian&Latin font settings.

The issue here is when converting the textbox into image, Aspose disregards the font in the textbox. But in Office Excel when copy-pasting as image, Excel will use the font setting from the textbox correctly.

Thanks

Hi,


Thanks for sharing further details.

We need to evaluate your issue thoroughly if Aspose.Cells does ignore Asian fonts settings where as MS Excel does not for the contents in TextBox. I have logged further comments against your issue “CELLSNET-45415” for product team’s reference.

Once we have any new information, we will share it with you here.

Thank you.

@ServerSide527,

Please try our latest version/fix: Aspose.Cells for .NET v17.8.7:

Your issue should be fixed in it.

Let us know your feedback.

Hi,

Thanks for providing the latest version.

It seems the it’s now using the correct font name but the alignment is wrong. The Asian text in the image is at bottom while in the excel the alignment is centre.

Please find the attached screenshot with the difference highlighted.
image.png (20.5 KB)

Thanks

@ServerSide527,

Thanks for the screenshot.

I noticed the issue is subtle. Could you re-attach the template Excel file here as we removed your file in the database after fixing it, we will check it soon.

Please find the attached test Excel file
test.zip (7.8 KB)

@ServerSide527,

Thanks for the template file.

I noticed the alignment issue is still there. I have logged your concerns against your issue into our database. Our concerned developer will look into it soon.

The issues you have found earlier (filed as CELLSNET-45415) have been fixed in Aspose.Cells for .NET 17.9.

Hi,

The alignment issue is still observable in 17.9. Could you please take a loot into it?

Thanks

@ServerSide527,

Yes, alignment issue might be there. Please spare us little time. Once we figure it out, we will provide you the fix.

@ServerSide527,

This is to inform you that we have logged a separate ticket for the alignment issue you pointed out to manage issues accurately. The issue is logged as following:
CELLSNET-45660 - Sheet to Image rendering - alignment issue for Asian fonts

Once we have an update on it, we will let you know here.

@ServerSide527,

This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-45660”) now. Hopefully, we will provide you the fixed version in the next few days (2-3 days or so) after performing QA and incorporating other enhancements and fixes.

@ServerSide527,

Please try our latest version/fix: Aspose.Cells for .NET v17.9.2:

Your issue “CELLSNET-45660” should be fixed in it.

Let us know your feedback.

The issues you have found earlier (filed as CELLSNET-45660) have been fixed in Aspose.Cells for .NET 17.10.