Real Software Forums

Linux Fonts on Chart Director
Page 1 of 1

Author:  Jason_Adams [ Mon Jan 30, 2012 4:34 pm ]
Post subject:  Linux Fonts on Chart Director

It's incredibly specific, but I figured, "What the heck, someone might run into this."

If you're running a WE app on Ubuntu and use the MBSChartDirectory plugin, you will quickly find that fonts do not draw correctly. So, for example, if you have a table drawn in your chart, it will be empty and tiny. The reason for this is simple: It doesn't know where fonts are on linux.

Now, if you have a full blown version of Ubuntu going, the solution is easy.

However, if you're like me and using something LAPP, which uses only the core of Ubuntu, then there's some extra steps because no fonts loaded. So, basically, if you go to /usr/share and there is no font directory, then keep reading. If you have Gnome or something installed, just use that to install the fonts. A quick Google search should tell you how. But if you don't, or just want to feel cool, then load up the shell.

(For the following, ignore $sudo if you're using the Root account. Also, I'm installing the Microsoft core fonts because they're useful to have and reliable.)

Step 1:
Type in: $sudo apt-get install msttcorefonts

If it works, go through the process and you're good! Go to Step 4!

Step 2:
"Oh no! It said it couldn't track the installation!"

Yeah, so did mine. The likely reason for this is that the core was modified to refuse all remote (www) locations, except a permitted list. If you're using Turnkey Linux, go to Step 3; if not, look up how to accomplish this on the site where you got your modified OS, try Step 1 to see if you fixed it, and meet me back at Step 4.

Step 3:
We're back in the shell. Let's open the file in nano that is holding us back:

Type in: $sudo nano /etc/apt/sources.list.d/sources.list

Now, in nano, find all the lines that end in multiverse, remove the "#" to uncomment them, and backspace to remove the whitespace. Then exit and save it on your way out. Now Step 1 should work. If it does, go on to Step 4.

Step 4:
Success! The last thing to do is to decide which font you want Chart Director (CD) to use. You can switch this up from chart to chart, but what's important to know is that CD is looking for the directory with the fonts in it. So if you type in "/user/fonts/truetype" it won't work. Why? Because that's a listing of the fonts you installed. You have to go one step further to get it working.

So if you followed my steps exactly, inform CD that your Search Path is "/usr/share/fonts/truetype/msttcorefonts"

Hope this helps! :)

Author:  Bob Keeney [ Mon Jan 30, 2012 8:49 pm ]
Post subject:  Re: Linux Fonts on Chart Director

This is awesome! This was on my list of things to figure out. Thank you!

Author:  bsumpter [ Wed Apr 10, 2013 6:39 pm ]
Post subject:  Re: Linux Fonts on Chart Director

Sorry to dig up an old topic, but this is a very specific subject.

In my case, I would rather include a font to be used by ChartDirector rather than instructing the users to install fonts on the system. Is it possible to simply include a public domain font with the redistributable, and have ChartDirector use that?

Author:  bsumpter [ Wed Apr 10, 2013 7:06 pm ]
Post subject:  Re: Linux Fonts on Chart Director

Seems like whenever I post here I end up answering my own question within minutes. Maybe I should post more often? LOL

The following bit of code does the trick for Linux systems, and allows inclusion of your own fonts.

#if TargetLinux then
CDBaseChartMBS.SetFontSearchPath "/path/to/fonts"

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group