Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue May 23, 2017 3:50 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Linux Fonts on Chart Director
PostPosted: Mon Jan 30, 2012 4:34 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
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! :)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Last edited by Jason_Adams on Wed Feb 01, 2012 11:46 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Linux Fonts on Chart Director
PostPosted: Mon Jan 30, 2012 8:49 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
This is awesome! This was on my list of things to figure out. Thank you!

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
 
 Post subject: Re: Linux Fonts on Chart Director
PostPosted: Wed Apr 10, 2013 6:39 pm 
Offline

Joined: Sun Mar 06, 2011 6:37 pm
Posts: 15
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?


Top
 Profile  
 
 Post subject: Re: Linux Fonts on Chart Director
PostPosted: Wed Apr 10, 2013 7:06 pm 
Offline

Joined: Sun Mar 06, 2011 6:37 pm
Posts: 15
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"
c.setDefaultFonts("font-normal.ttf","font-bold.ttf","font-italic.ttf","font-bold-italic.ttf")
#endif


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group