[osg-users] osgText::readFontFile returns NULL on valid argument
Cole, Charles E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]
charles.e.cole at nasa.gov
Wed Mar 18 05:54:51 PDT 2009
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.
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Jesper
Sent: Wednesday, March 18, 2009 7:57 AM
To: osg-users at lists.openscenegraph.org
Subject: [osg-users] osgText::readFontFile returns NULL on valid
Hi all, I have a rather strange problem.
I'm using osgText in my project, but I'm getting null as return from
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...
More information about the osg-users