Many thanks for the follow-up. In fact we considered it as an issue (not only a new feature) because it had impact on the existing image rendering feature. A chart with this kind of settings cannot be rendered properly to an image. Please find my test code below:
var workbook = new Workbook(@“test.xlsx”);
var options = new ImageOrPrintOptions
{
ImageFormat = ImageFormat.Emf,
ChartImageType = ImageFormat.Emf,
OnlyArea = false,
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
OnePagePerSheet = true
};
workbook.Worksheets[0].Charts[0].ToImage(@“testout.emf”, options);
I’ve attached the test files for your reference. As you can see if I copy/paste manually using Office the fonts are correct for both Asian and Latin characters, while if I used Aspose rendering the font were wrong for Asian text (Please see my screenshot).
I wanted to attach the font file (simkai.tff for KaiTI) for your convenience but the file size exceeded the limit, so if you still need the font file please let me know the alternative method to provide, otherwise you can use any Asian font to reproduce the issue.
Could you please check the attachments and see if the image rendering is a separate issue and could it be fixed?
You get rendering error because this feature i.e. CELLSNET-46058 is not supported at the moment. Once, this feature is implemented, we think, rendering problems of the chart should also be resolved.
However, we have tested your code and found the rendering problem in chart so we have recorded it as follows.
CELLSNET-46062 - Legend of Chart is not rendered properly because of Asian and Latin Characters
I believe we only need Aspose to access the properties that we can naturally access using Ms Excel, if there’s no equivalent in Ms Office (as in, they are hard-coded in Excel), we should be in the good place. We expect Aspose to behave the same as in office, but we don’t expect it to access anything beyond using Office manually.
I have noticed in 18.5 release note it mentioned “Adds TextOptions.FarEastName and TextOptions.LatinName properties”.
Regarding ticket 46058, I have tried myself and noticed I could indeed access the FarEast font and the Latin font. However I still couldn’t find a way to access these options in chart legend. Is there any update on this?
In fact the version I tested this morning was 18.5.1 already and all my conclusion and comments above were based on this version (including the alignment issue in rendering).
I’m looking forward this feature fully supported in charts and the image text alignment issue being corrected.
Thanks for looking into this. Looks like your pc didn’t have the Asian font I used installed. The font for Asian is KaiTi. (You can see the font in my screenshot is different from your screenshot)
KaiTi font is already installed on my machine and when I try to install the font that is downloaded from your location (URL), I get the message that this font is already installed on your machine.
Many thanks for checking this. I had a look again and think it might be the Latin font, not the Asian font. Please see my screenshot where you can see the Latin text in your output looks different than the one in Excel/my output: image.png (92.8 KB)
I’ve attached the font file for your convenience. Could you please kindly check?
Thanks for the further information and using Aspose.Cells.
We were able to observe the text alignment issue in the chart image and logged it in our database for investigation and for a fix. Once, we will have some news for you about it, we will update you in this topic.
This issue has been logged as
CELLSNET-46149 - Text Alignment Issue in the Chart Image
The issues you have found earlier (filed as CELLSNET-46149) have been fixed in Aspose.Cells for .NET v20.5. This message was posted using Bugs notification tool by Amjad_Sahi
The issues you have found earlier (filed as CELLSNET-46062) have been fixed in Aspose.Cells for .NET v20.6. you may also get the version @ NuGet repos. here (NuGet Gallery | Aspose.Cells 20.6.0).This message was posted using Bugs notification tool by Amjad_Sahi
The issues you have found earlier (filed as CELLSNET-46062) have been fixed in Aspose.Cells for .NET v20.6. you may also get the version @ NuGet repos. here (NuGet Gallery | Aspose.Cells 20.6.0).This message was posted using Bugs notification tool by Amjad_Sahi
Thanks for the updates. I tried to upgrade today and can see Font class is now also TextOptions which has access to Latin and FarEast font names.
However, there’s a regression related to the font names that blocked my upgrade. I noticed the font name of legend entries are incorrect in the new version.
Code:
var workbook = new Workbook(@".\test.xlsx");
var chart = workbook.Worksheets[0].Charts[0];
// var fontLatinNameOfLegendEntry = ((TextOptions)chart.NSeries[0].LegendEntry.Font).LatinName;
var fontNameOfLegendEntry = chart.NSeries[0].LegendEntry.Font.Name; // Returns correctly as ‘Arial’ in 20.3.0 but wrong ‘Calibri’ in 20.6.0
Supposedly the font name of the series legend entry should be ‘Arial’ which was the case in the old Aspose version, however, in the new version, it is using ‘Calibri’.
I’ve attached my test file here: test.zip (28.1 KB)
As you already escalated it in enterprise support desk, so you may follow up your thread to get updates or fixed version. Hopefully your issue will be fixed soon.