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

Message ListMessage List     Post MessagePost Message

  Unicode font won't increase past 12
Posted by Jason on Jul-04-2011 01:06
The below code will add a very small solid black square that you can barely see.

[quote]
c.addText(50, 50, unicode(unichr(0x25A0)).encode('utf-8'))
[/quote]

For some reason it completely disappears when I try to increase the font past 12.

[quote]
c.addText(50, 50, unicode(unichr(0x25A0)).encode('utf-8'), "cour.ttf", 20)
[/quote]

I'd like to use the built in symbols, but addText doesn't support that, and currently the square is barely noticeable at 12 font.  Are there any solutions?

  Re: Unicode font won't increase past 12
Posted by Peter Kwan on Jul-04-2011 08:01
Hi Jason,

Are you using ChartDirector on Linux or FreeBSD or Solaris?

The "cour.ttf" (Courier) is a Windows/Mac OS X font. It comes with Windows and Mac OS X. It may not exist on Linux/FreeBSD/Solaris.

On Windows/Mac OS X, the fonts are provided by the OS, and ChartDirector will use those fonts. On Linux/FreeBSD/Solaris, there is no standard location for the fonts, so ChartDirector will use the fonts on its fonts subdirectory (the fonts subdirectory is in the same directory that contains "libchartdir.so"). Have you installed the "cour.ttf" in the ChartDirector fonts subdirectory? (ChartDirector does not come with "cour.ttf" or other Microsoft/Apple fonts, as they are copyrighted.)

If you have not install any fonts, ChartDirector will use "substitute fonts" included in the ChartDirector distribution. The "substitute fonts" are just basic fonts and are provided so that you can run the sample programs. If you are using non ASCII characters (like  unicode 25A0), it is likely not in the substitute fonts. You may want to install the real fonts.

Microsoft allows people to download some of their fonts to run on other OS free of charge, so you may try to download "cour.ttf" to the ChartDirector fonts subdirectory. See:

http://www.microsoft.com/typography/faq/faq8.htm

http://sourceforge.net/project/showfiles.php?group_id=34153&release_id=105355

See "Font Specification" in the ChartDirector documentation for details. (You may look for "Font Specification" from the ChartDirector documentation index.)

Hope this can help.

Regards
Peter Kwan

  Re: Unicode font won't increase past 12
Posted by Jason on Jul-04-2011 10:15
You were on the money about using Linux, and it not supporting the Windows font.  I installed it like you recommended and it works great, thanks!