Text cut off in rendered image when a cell has more than one fonts

Hi,

When rendering a sheet with a cell that contains two fonts (DFKai-SB for Asian text and Arial Narrow for numbers), the text is cut off in the rendered image.

Code:
var newWorkbook = new Workbook(@“test.xlsx”);
var options = new ImageOrPrintOptions
{
ImageFormat = ImageFormat.Emf,
OnlyArea = false,
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
OnePagePerSheet = true,
Transparent = true
};

        var sheet = newWorkbook.Worksheets[0];
        sheet.PageSetup.PrintArea = "B5:E10";
        sheet.PageSetup.LeftMargin =
        sheet.PageSetup.RightMargin = sheet.PageSetup.TopMargin = sheet.PageSetup.BottomMargin = sheet.PageSetup.HeaderMargin = sheet.PageSetup.FooterMargin = 0;
        SheetRender render = new SheetRender(sheet, options);
        render.ToImage(0, @"out.emf");

This issue doesn’t happen if there’s only one font set in the cell.

To make the test easier, I’ve attached a screenshot along with the test files and font file for your reference.

test.zip (2.8 MB)
screenshot.png (3.9 KB)

Could you please look into this?

Thanks,

@ServerSide527

Thanks for using Aspose APIs.

We were able to find very tiny difference after rendering the text in cell B7. We have logged it in our database for further analysis and investigation. We will look into it and fix it if possible. Once, there is some news for you, we will update you asap.

This issue has been logged as

  • CELLSNET-45945 - Text cuts off in rendered image when a cell has more than one fonts

@ServerSide527

Please download and try the following fix for your issue logged as CELLSNET-45945.

Hi,

Thanks for the update.

I have tested and noticed the rendered text looks much better now indeed. Thanks very much for the quick fix!

@ServerSide527

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved with the latest fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.

Hi,

I have tested using the official release 18.3.0 today but I did not get the same result as when I tested the pre-release 18.2.6. The text has been cut off again.

I also noticed this ticket is still ‘open’, could you please let me know if the fix has been included in the latest official release?

Thanks,

Hi,

I have actually tested it again using 18.3.0 and seemed I cannot see the issue (maybe I was using a wrong version). I will let you know if I could replicate again.

However it still confused my why the ticket is open, is there any known issue ongoing on this ticket?

Thanks,

@ServerSide527

We are about to close this ticket. We were waiting for your feedback. Please let us know if you still find some issue. We will close the ticket with your positive results in testing.