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

Message ListMessage List     Post MessagePost Message

  Arial font with mono Linux
Posted by Jonathan on Nov-17-2010 06:21
When I generate a chart with ChartDirector for .Net on Linux (with mono), I am unable to use the arial font.  Whenever I specify "Arial" as the font name, it uses "Nimbus sans" instead.

After looking at the documentation, I tried specifying "arial.ttf" as the font name and I still have the same problem.

Here's the output of the testFont method :

Font arial.ttf is mapped to Arial.
Font Arial successfully opened as [Font: Name=Nimbus Sans L, Size=11, Units=2, GdiCharSet=1, GdiVerticalFont=False]

I then tried to rename my arial.ttf file to myarial.ttf.  Now here's the output of the testFont method :

Trying to open font myarial.ttf at 8 pts.
Font myarial.ttf looks like a font file name - search and open it.
Successfully opened ./fonts/myarial.ttf.

So now it works, but I had to rename the font file.  Is there a way to make it work without having to rename the file?

  Re: Arial font with mono Linux
Posted by Peter Kwan on Nov-17-2010 16:41
Hi Jonathan,

For ChartDirector for .NET, if you use the "Arial" font, but you actually get the "Nimbus Sans L" font, that means your system does not have the Arial font at all.

All Windows systems have the Arial font. On the other hand, non-Windows system may not come with the Arial font. To solve the problem, please install the Arial font in your system. Please refer to the documentation of your system on how to install the Arial font.

Most editions of ChartDirector also supports "private fonts", that is, fonts that are not installed in the system or programming framework (and therefore is not visible to .NET as fonts), but are just provided as data files.

However, due to compatibility with previous versions of ChartDirector, for some "well-known" fonts, the file names are automatically mapped to the logical font names. For example, "arial.ttf" is automatically converted to "Arial" by ChartDirector, and is not treated as a "private font". The "well-known" fonts include "Arial", "Times New Roman" and "Courier New" (and their bold, italic, and bold italic variants). These well-known fonts come with Windows, but may not come with Linux.

So for these well-known fonts, you would need to install them in your system so that they are recongnized by your system. The private file names must not be one of the well-known font file names.

So in summary, to make it work without renaming the font file, please install the font in your system so that the .NET framework can see the font.

Hope this can help.

Regards
Peter Kwan