[osg-users] osgText::readFontFile returns NULL on valid argument

Jesper D. Thomsen jdt at anybodytech.com
Wed Mar 18 04:57:25 PDT 2009

Hi all, I have a rather strange problem.

I'm using osgText in my project, but I'm getting null as return from this method:

osgText::Font* t_font = osgText::readFontFile("fonts/arial.ttf");

The strange part is that when I compile and run the osgText and osgHud examples, it works just fine (so it isn't the font-file which is missing). It only happens in my own program.
So far I have tested it on both Vista and XP machines in the office, and this doesn't seem to affect the problem. However, my program works just fine on a single XP machine, but not on any of the other machines. I have tried in both debug and release modes, and tried both copying the executable and building it on different machines, and so far it is consistent in that the deciding factor is which machining is running the program and not which machine it was built on.

I'm using OSG 2.6.1 in Visual Studio 2005 sp1 on a Vista machine (but have tested on XP also).

Since the osg examples work just fine on the same machine, I guess it is something I have done in either the project settings or somewhere in the code, but I'm running out of ideas. If anybody have tried something like this, or knows what could cause this, I would very much appreciate it.

regards, and thanks in advance.

Jesper D. Thomsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090318/4d587465/attachment-0002.htm>

More information about the osg-users mailing list