Hi Jesper,
My first inclination is that the path is incorrect, or at least doesn't match with where the font file actually is. With the code snippet you listed, I believe that the file (and path) that you list must be relative to your project's compiled executable. That would be the first thing that I'd check, and Paul's tip on adding the OSG_NOTIFY_LEVEL can help if you can run your executable from a DOS window. Another means of checking is to place the font file in the same directory as your executable and change the readFontFile parameter to just "arial.ttf". If that works, then that confirms that it's a path issue. Hope that helps. Chuck From: [email protected] [mailto:[email protected]] On Behalf Of Jesper D. Thomsen Sent: Wednesday, March 18, 2009 7:57 AM To: [email protected] Subject: [osg-users] osgText::readFontFile returns NULL on valid argument 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
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

