ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  No text shown on axis labels, legends or other text boxes
Posted by Stephan Bielmann on Dec-14-2017 20:47
Hello,

we do have a case on one single computer. It is running CentOS 7.4.1708, 64Bit. All charts are rendered correctly as they should, however no text is shown at all. As if the fonts were missing or invisible. No text in axis labels, or legends, or other text boxes that we use to add text to the charts.

The fonts are as usual in a subdirectory fonts, right where ChartDirectory SO file is.

We have other PC's with the very same CentOS and application version, where all works fine.


Our application is written in C++, 32bit, with ChartDirector CPP version 6.

A previous release of our application, which used ChartDirector 5, does work correctly on that PC.


Do you have an idea where I could look, what to investigate, or what I could check on that PC ?

Thank you for your help,
Stephan

  Re: No text shown on axis labels, legends or other text boxes
Posted by Peter Kwan on Dec-15-2017 01:55
Hi Stephan,

Please try the testFont API that will perform a font loading test and displays the result. See:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&pattern=testFont&thread=1371624839#N1371638072

Please make sure you are running the testFont API in the same context as the code that shows no text. For example, if the original code is a background application starting as a cron job, testing the code from the command shell may not be accurate. It is because the command shell may have a different search path from the cron job, and it may have different security. (The cron job may be running using a different account with different privileges.)

If the above still cannot solve the problem, please kindly let me know what is the result of the font loading test.

Regards
Peter Kwan

  Re: No text shown on axis labels, legends or other text boxes
Posted by Stephan Bielmann on Dec-15-2017 13:54
Hello Peter,

this is what I get, with Chart::testFont(), error 81 when trying to load the font:

Searching for arial.ttf - No such file or directory [err code = 2]
Searching for /home/test/chartdir/lib/fonts/arial.ttf - No such file or directory [err code = 2]
Searching for LiberationSans-Regular.ttf - No such file or directory [err code = 2]
Error loading /home/test/chartdir/lib/fonts/LiberationSans-Regular.ttf [FT err code = 81]
Searching for helvR10.pcf - No such file or directory [err code = 2]
Searching for /home/test/chartdir/lib/fonts/helvR10.pcf - No such file or directory [err code = 2]

The file however exists and is accessible:

ls -l /home/test/chartdir/lib/fonts/LiberationSans-Regular.ttf

-rw-r--r-- 1 user2 user2 350200  8. Jul 2016  /home/test/chartdir/lib/fonts/LiberationSans-Regular.ttf

It just belongs to another user, however this is always the case in our setup.


Thanks for any help, Stephan

  Re: No text shown on axis labels, legends or other text boxes
Posted by Stephan Bielmann on Dec-15-2017 14:04
I forgot, the file is 100% the same as on other systems where it works fine. Cross checked with md5 sum.

  Re: No text shown on axis labels, legends or other text boxes
Posted by Peter Kwan on Dec-16-2017 16:52
Hi Stephan,

The FT err code 81 is the error reported by the "Freetype" library that we are using in ChartDirector. (The FreeType library is mentioned in the ChartDirector LICENSE.TXT file as one of the libraries we used in ChartDirector.)

When Freetype error occurs, ChartDirector will try to open the file. If ChartDirector cannot open the file, it will report why the file cannot be opened. If ChartDirector can open the file, it just reports the original Freetype error code. The strange thing we are unable to see how this error code can occur in the Freetype version we used on Linux. (On the Freetype version we used on other OS, this error can occur if the file can be opened using "fopen", but detecting the file cursor position using ftell fails.)

For your case, is it possible to perform the following test:

- Try to change the access right to rw_rw_rw (chmod 666 *.ttf) to see if this works. If seLinux (secure Linux) is in force, there might be additional security restrictions (such as access contro list) not visible by using "ls -l".

- Try to delete fonts directory entirely. Download ChartDirector for C++ to the machine directly. Untar the distribution, and copy the fonts directory to the location of the deleted fonts directory.

- If the problem continues, copy the Microsoft font "arial.ttf" to the fonts subdirectory. You can legally download and use the Arial font on Linux. See below. Try the testFont again to see if it works. ChartDirector should find the "arial.ttf" font and try to use it. This is to check whether the issue is specific to the LiberationSans-Regular.ttf, or to all ttf files.

http://sourceforge.net/project/showfiles.php?group_id=34153&release_id=105355
http://www.microsoft.com/typography/faq/faq8.htm


You mentioned you are using 32-bit ChartDirector for C++ on 64-Linux. Does it mean you are using "ChartDirector for C++ for Linux (i386/i686)" and the compiled 32-bit executable runs directly on 64-bit Linux (as opposed to running inside another virtual machine inside the Linux). This usually requires installation of additional 32-bit system libraries on the 64-bit Linux.

Please try to issue the command "ldd xxxx" where xxxx is the executable of your program. This should display the shared libraries that your executable depends on. It should depend on libchartdir.so and a few other libraries. Does it include another copy of freetype "libfreetype.so"?

Regards
Peter Kwan

  Re: No text shown on axis labels, legends or other text boxes
Posted by Stephan Bielmann on Dec-18-2017 16:08
Hello Peter,

thank you for all the hints. Working with a copy of arial.ttf does work, everything else does fail. The person that installed the laptop told me that there is an issue with the graphic card driver and the kernel settings. I suspect this could be the reason, also because it is the only PC where we encountered this issue, out many.

We will reinstall a clean Linux on that laptop, start over and check again.