SetStyle font not applied for certain fonts

Hi

This may be a duplicate post, but if it is, I could not find anything in Aspose.Cells forum.
Consider the following code:

ws.Cells(2, 0).Value = "نام همکار: " & fss(i).FirstName & " " & fss(i).LastName
rng = ws.Cells.CreateRange(2, 0, 1, 4)
rng.Merge()
st = wb.CreateStyle
st.Font.Name = “B Nazanin”
st.Font.Size = 11
rng.SetStyle(st)

This successfully applies “B Nazanin, 11, Regular” font on cell C1. But when running this code in the same subroutine:

ws.Cells(rhs.Count + 5, 0).Value = “ارزیابی عمومی و رفتاری”
rng = ws.Cells.CreateRange(rhs.Count + 5, 0, 1, 12)
rng.Merge()
st = wb.CreateStyle
st.Font.Name = “B Titr”
st.Font.Size = 14
rng.SetStyle(st)

and opening generated xlsx file in Excel 2013, it says that font is “B Titr, 14” but what is displayed is “Arial, 14”! When changing font to another one and then back to “B Titr” (without any other change), font display problem is solved. Both fonts are installed on machine and tests are done on that machine. A sample output file (as image) is attached. Blue-highlighted cells are set to “B Nazanin, 11” through code. Red-highlighted cells are set to “B Titr, 14” through code, but are not displayed correctly and green-highlighted ones are set to “B Titr, 14” manually in Excel. This problem persists by using any other font instead of “B Titr” (of course except “B Nazanin”) regardless of applying to a single cell or a range. Can anyone help? Platform info: Aspose.Cells 8.6.0.0 on VS 2013 (ASP.NET/VB.NET 4.5.1), Win 2012 R2.

Thanks

Hi Mohamamd, Greetings.

Thanks for your posting and using Aspose.Cells.

Please provide us some sample console application that should be runnable and your Arabic/Farsi fonts. Please also provide us your actual and expected excel files which you can create manually using Microsoft Excel.

Please also download and try the latest version: Aspose.Cells
for .NET v8.6.0.4
and see if it makes any difference.

It will also be helpful if you could provide more screenshots describing your issue in detail. We will look into your issue and help you asap.

Thanks Shakeel,

Attached to this reply, you can find a sample windows application, a folder containing fonts and an expected sample output which should be generated by that application. I don’t think this is a version-related issue. There should be some trick which I don’t know (Yesterday, Amjad Sahi taught me such a trick in style application).
About screenshots, please tell me what should I exactly post? From which part of my application/code?

Regards.

Hi,

Thanks for your quick reply and providing us the sample application and using Aspose.Cells.

Please spare us some time, we will evaluate your issue and may be we don’t need any screenshot(s). In case, we need them we will ask you to provide them and also let you know what specific thing we need. Once, we have some update for you, we will let you know asap.

Hi Muhammad,

Thanks for a good sample application and providing us the necessary fonts and expected output excel file as well as using Aspose.Cells. We appreciate it.

We have tested this issue with the following sample code using the latest version: Aspose.Cells
for .NET v8.6.0.4
and were able to observe the issues. I have attached the font files, expected output excel file, pdf generated with Aspose.Cells and pdf generated with Microsoft Excel 2013 with this post for a reference.

If you check the Aspose.Cells generated PDF and the Microsoft Excel generated PDF, you will see that Aspose.Cells is not picking up the fonts like Microsoft Excel. Please note I installed the fonts on Windows/Fonts directory so Aspose.Cells should automatically pick up the fonts which is unfortunately not the case.

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-43979 - SetStyle font not applied for certain fonts

C#
Workbook workbook = new Workbook(“Expected Output.xlsx”);
workbook.Save(“cells-output.pdf”);

Thanks for your effort and feedback. I’m waiting for good news from you.

Regards.

Hi,

Thanks for your posting and using Aspose.Cells.

We are hopeful your issue will be fixed soon. Mostly such issues take a week or may be two to get fixed. Also I have updated the above post to add more description of the issue for product team reference.

Hi,

Thanks for using Aspose.Cells.

This is to inform you that we have fixed your issue CELLSNET-43979 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Hi.


Many thanks for your quick action. I’m waiting for the fix.

Regards.

Hi again.


I’m still waiting for a fix to this problem. Besides first post, it is said that issue is resolved. Can I ask about its possible release date?

Thanks.

Hi,

Thanks for your posting and using Aspose.Cells.

Yes, your issue is already resolved. We are hopeful you will get a fix before this Friday. Mostly, we provide fixes on Friday but sometimes we also provide fixes in other days. Please spare us some time. We will share good news with you soon. Thanks for your patience and understanding.

That’s very good. I’m waiting for it. Many thanks.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.6.0.7 and let us know your feedback.

Hi


You’re GREAT! You did it! Many thanks. Works seamlessly.

Regards.

P.S: I’m very satisfied with your support. I had many posts in past 10 days and you (Aspose Team) have always did your best to help me (and certainly all other customers). I hope you continue as good as so far - and I’m sure you will do it even better :).

Hi,

Thanks for your kindness, appreciation and using Aspose.Cells.

We are pleased to know that you are happy with us and liked Aspose and also your issue is resolved now. Let us know if you encounter any other issue, we will be glad to look into it and help you further. Best wishes and good luck in future. Have a good day. :slight_smile:

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


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