Font "Wingdings 3" representation on CentOS


#1

Hello, there.

I have a problem with displaying the font wingdings 3 with Aspose.Cell. The fonts are installed in usr/share/fonts. The funny thing is, with Aspose.Word it is displayed normally. In Aspose.Cell I only see boxes.

With Aspose.Cell I open an Excel document and extract images, which I then copy into a Word document, which I save. In the extracted images are the boxes. Other text strings in Word with Wingdings 3 are displayed normally.

Could someone help me or give me a hint?

Thank you and best regards


#2

@TarekA,

Thanks for the details.

It looks like your issue is due to missing font (used in the workbook) or the API could not find the font. You should specify your custom folder (containing the required fonts in it) at the start of the program, see the document for your reference:
https://docs.aspose.com/display/cellsnet/Configuring+Fonts+for+Rendering+Spreadsheets


#3

@Amjad_Sahi
Thanks. I’ve been trying to do this:

Aspose.Cells.FontConfigs.SetFontFolder("/usr/share/fonts", true);

than this:

var fontFolder = "/usr/share/fonts/TTF";
var fontFile = fontFolder + "/WINGDNG3.TTF";

//Defining FolderFontSource
FolderFontSource sourceFolder = new FolderFontSource(fontFolder, false);

// Defining FileFontSource
FileFontSource sourceFile = new FileFontSource(fontFile);

// Defining MemoryFontSource
MemoryFontSource sourceMemory = new MemoryFontSource(System.IO.File.ReadAllBytes(fontFile));

// Setting font sources
FontConfigs.SetFontSources(new FontSourceBase[] { sourceFolder, sourceFile, sourceMemory });

Unfortunately, in both cases boxes are still displayed. Before I had installed wingdings 3, Aspose.Cell showed me Arial or Calibri for Wingdings 3. So normal letters instead of the symbols of Wingdings3.

Any other suggestion?


#4

@TarekA,

Thanks for the sample code segment.

Could you provide us your template Excel file and font files (used in the workbook e.g Wingdings font, etc.) to evaluate your issue. Please zip the files prior attaching here. Also provide your output PDF file. We will check it soon. Moreover, could you try your scenario/case on Windows if you still see the issue or not?

PS. Please try our latest version/fix: Aspose.Cells v18.11.x (if you are not already using it).


#5

wingdings_font_problem.zip (64.4 KB)

Enclosed are the files.

It works fine in Windows. But I have to get it to work under CentOS. I also use the latest version 18.11.


#6

@TarekA,

Could you also include the sample code which you are using to extract images and copy them to the Word document so that we can reproduce the problem on our end then provide our feedback after analysis. Also mention if the fonts are rendered fine when you save or manipulate the same template file using MS Excel in your CentOS.


#7

sample_code.zip (809 Bytes)

Enclosed the example code.

The part where I copy the image into the Word document is not included. The error occurs already before. I am already displaying the image on the web interface and unfortunately it already has the boxes there. And only in interaction with the users do I copy it into a Word document.

I have not installed MS Excel in CentOS. Could just maybe install the Wine version.


#8

@TarekA,

Thanks for the code segments.

Could you provide more details and elaborate on your environments. Are you using Aspose.Cells for .NET Standard version or Aspose.Cells for .NET Framework version (that runs on mono)?


#9

I am creating an ASP Net Core 2.1 application. I am using Aspose.Cells for .NET (https://www.nuget.org/packages/Aspose.Cells)


#10

@TarekA,

We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46482 - Font "Wingdings 3" representation on CentOS having issues by displaying boxes

#11

@TarekA,

We evaluated/tested your issue for your scenario (environment). We could not reproduce the issue with your shared fonts, the image gets generated ok on our end. Please make sure that the “Wingdings 3” font file can be accessed in your ASP Net Core 2.1 application.
e.g.
Sample code:

[HttpGet("preview/{id}")]
//Excel-File is in Database
public async Task<IActionResult> GetPreview(Guid id) {
try {
var existing = _ctx.Sheets.FirstOrDefault(x => x.Id id);
if (existing null) {
return NotFound();
}

```
var preview = new PreviewDTO();
```

```
FileStream fontStream = File.OpenRead(the "Wingdings 3" font file path);                log/display fontStream.Length, Data;
```

```
using (var stream = new MemoryStream(existing.File))                ...
```

Also, kindly save the workbook to PDF file format too. Then share with us the generated image and PDF file in your ASP Net Core 2.1 application. Finally, if possible, to trace the problem easier, please create a .Net Core console application and save the workbook to image and PDF, then share us the generated image and PDF file too. We will make further investigations.


#12

I have changed my requirements and now run the application on a Windows server. But again I have a problem with the font. When I insert an SVG with Wingding’s font with Aspose into Word, a default font will be displayed instead, not Wingding’s.

If I drag and drop the SVG into Word, I see the Wingdings. Enclosed is the SVG I drag in, the result and my code to insert the SVG.

Would you have a hint?
svg_problem.zip (2.6 MB)


#13

@TarekA,

Thanks for the SVG file and template files, etc.

I think you should separate the issue. If the SVG file generated by Aspose.Cells is itself ok as can be seen in IE or its viewer, then the issue might be on Aspose.Words end. You should post your issue with details and samples in Aspose.Words forum, one of my fellow colleagues from Aspose.Words team will help you there.

By the way, your issue might be due to missing fonts on Windows server, so you should install the underlying fonts prior trying your code segment.