When setting font for individual characters in a cell, the Excel file gets corrupted with the recent versions of Aspose.Cells. It worked properly with older versions (e.g. Aspose.Cells 18.3.0).
var workbook = new Workbook(@".\test.xlsx");
var cellD5 = workbook.Worksheets.Cells[“D7”];
cellD5.Characters(0, 1).Font.Name = “DFKai-SB”;
cellD5.Characters(1, 1).Font.Name = “DFKai-SB”;
var cellB58 = workbook.Worksheets.Cells[“B58”];
cellB58.Characters(0, 1).Font.Name = “DFKai-SB”;
cellB58.Characters(1, 1).Font.Name = “DFKai-SB”;
workbook.Save(@".\out.xlsx"); // corrupted file in 21.11.0 but correct file in 18.3.0
Setting font for individual characters is a useful feature to have multiple fonts in one cell, and is also supported in MS Excel. With the recent versions, this seems to not always work. Also note that it seemed to only happen with cell D7 and B58, applying the same procedure on all other cells worked fine.
I’ve attached the test files and the font ‘DFKai-SB’ for your reference.
test.zip (2.8 MB)
Since it was working fine before there might be a regression. Could you help me check?