Problem with Persian Fonts

I found out that Aspose.Cells has problem with Persian fonts like "B Traffic" even when you do not need pdf export and just change font of a cell. I give you an example code
Aspose.Cells.Workbook wb = new Workbook();
var sheet = wb.Worksheets[0];

var cell = sheet.Cells[0, 0];
cell.Value = "سلام";

var style = cell.GetStyle();
style.Font.Name = "B Traffic";
style.Font.Size = 20;
cell.SetStyle(style);

sheet.AutoFitColumn(0);
wb.Save("d:\\test2.xlsx");
when you open saved file in MS Excel you can see that the font is not correct. you can see correct font when you change the cell's font to another font and then change it again to "B Traffic".

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have run your sample code and found out that it is working fine. When you click on the cell A1, you see the font name is B Traffic and font size is 20.

Please see the screenshot for your reference.

Screenshot:

You are right about font name and size but the correct font is like this. not the one in your screenshot. please do as I said in the first post and see the difference. "you can see correct font when already have installed it and change the cell’s font to another font and then change it again to “B Traffic”.You can see screenshot with correct font in the attachment. I guess the font in your screenshot is Arial. Aspose.Cells has changed the font name of the cell to “B Traffic” but the real visible font of the cell is Arial.


Do you see the problem? Is there any solution?

I have found the source of the problem. if you open the xlsx file generated with the Aspose.Cells With WinRar and open styles.xml there is an XML node for the “B Traffic” font like this.

if you compare this XML node with the one in correct xlsx file generated with MS Excel you can see the difference.
now if you correct this node and put it back in xlsx file generated with Aspose.Cells the font will be shown correctly in MS Excel.
Would you please tell me, Will this issue be fixed soon?

This problem is not worth enough to have an answer? I’ve found the problem and I have found the answer so you just need to put it in your code.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

It seems your issue is related to this issue which you reported earlier relating to pdf and B traffic font.

https://forum.aspose.com/t/89905

We have already logged your issue in our database and it is fixed. Please spare us some time. We will soon provide you a fix.

OK. Thank you for the answer. I think they are related but are not the same. So I’ll wait for the fix and report the results.

[quote user=“alionline759”]I have found the source of the problem. if you open the xlsx file generated with the Aspose.Cells With WinRar and open styles.xml there is an XML node for the “B Traffic” font like this.

if you compare this XML node with the one in correct xlsx file generated with MS Excel you can see the difference.
now if you correct this node and put it back in xlsx file generated with Aspose.Cells the font will be shown correctly in MS Excel.
Would you please tell me, Will this issue be fixed soon?
[/quote]
Is there any progress in solving this issue? I have temporarily solved the problem using another Library (EPPLUS) but I must save the file using aspose.cells and open it using epplus. As I 've mentioned earlier the problem can be solved using on the font tag inside open xml file. so please inform me Is there any plan to fix this issue?

Hi Ali,

Thanks for your posting and using Aspose.Cells.

We were able to find the source of this issue as mentioned in your post. B Traffic font is not working fine but when the value of the Styles.xml is changed, it starts working fine.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-42550.

The issues you have found earlier (filed as CELLSNET-42550) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thanks for the fix.

The problem has been fixed for “B Traffic” font but still exists for other Persian fonts like “B Nazanin” , …
And the problem still exists generated pdf files.

Hi Ali,

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue with “B Traffic” font is now fixed. Let us know if you face any other issue with the “B Traffic” font.

For “B Nazanin” font, could you provide us more information. For example, sample xlsx files and screenshots, the MS-Excel generated PDF and Aspose.Cells generated PDF.

It will help us look into your issue more closely and we will be able to fix it asap.

Hi,

I’ve noticed that in the latest version of Aspose.Cells 8.0.2 it could handle “B Nazanin” font very well but although there is other fonts like this I suggest that you put “Charset” property in the Font Class so we can use it in our code for non popular fonts like “B …”.

Hi Ali,

Thanks for using Aspose.Cells.

Could you provide the fonts which are not working? Please provide us source xls/xlsx files that are using the fonts that are not working properly so that we could log this issue in our database for investigation and fix.

Development team will look into it and decide if it should add any Charset property or it could be handled in some other way. Thank you for your cooperation.