Chart image generated using Chart.ToImage: is not shown with our custom font

Hi,
we use Aspose Cells for Java version 17.8 and Aspose Word for Java version 16.12.0.
We have one excel file with a chart. In this file we use the font “Triglav” (our custom font) into the chart.
Using Aspose Cells, we extract an image of the chart and paste it on the word document with Aspose Word.
If our application server (Wildfly 12.0.0) is installed on Windows machine (Win10 64bit), the system works fine.
If our application server is installed on Linux machine (Ubuntu 16.04 LTS 64bit), the system returns an image of the chart without the font Triglav.

We have installed, the font Triglav, coping the file “ttf” into these directories on Linux machine (As explain at this link Using TrueType Fonts in C#|Aspose.Words for .NET ):

  • /usr/share/fonts
  • /usr/share/fonts/truetype
  • /usr/local/share/fonts

but the issue is present again.

Do you have any idea what could be the possible cause of this issue?
We have installed the font into the wrong directories?
The Aspose Cells version that we have installed have a bug? Is it possible that the issue “CELLSJAVA-42422 - Incorrect font is used in the PDF output of MS Excel chart” fixed on the version 17.11 solve our issue too?
Many thanks in advance.
Giulio

@giulio.andolfi,

Thanks for providing us details.

Well, generally it should work fine on Linux machines as well if the underlying fonts (used in the workbook) are installed and you have specified the fonts directories path in the code (at the start of the program before using any other APIs) fine. I suspect you might not be specifying fonts directories using Aspose.Cells APIs (it looks like you are only specifying the fonts directories using Aspose.Words APIs) at the start of your program. See the document on how to specify custom fonts folders using Aspose.Cells APIs for your reference:

Moreover, I would recommend you to kindly try our latest version/fix: Aspose.Cells for Java v18.8.x as in the latest versions we have enhanced the rendering modules further, so it is better to use latest version of the APIs set.

If you still find the issue with v18.8, kindly separate the issue regarding Aspose.Cells APIs and do provide us your template Excel file, output image, sample code (runnable) and output PDF files (you may also render to PDF by adding another line of code at the end of your program). Moreover zip the font files (.ttf files) and share it here. We will check it soon.

Thanks for your repley.
In our application we do not specifing the fonts directories. We try to specify the directories and we will try again.
We will let you know as soon as possible if the issue is solved
Regards.

@giulio.andolfi,

Please take your time to try your scenario/case as suggested. Hopefully it will fix your issue.

In case of any issue or queries, feel free to contact us, we will be happy to assist you soon.

Hi all,
I found our problem. We have installed the font without set the proper user rights.

Before

-rw-------

After

-rw-r–r--

Now it works without any version upgrade and without sets the font directories.

@giulio.andolfi,

Good to know that you have sorted out your issue now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.