diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index eaff1545c..e7a413102 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -63,6 +63,7 @@ static const char *s_default_dso_path = "/usr/lib/osgPlugins/"; static char *s_filePath = ".:"; #endif +static bool s_filePathInitialized = false; void osgDB::initFilePath( void ) { @@ -76,6 +77,7 @@ void osgDB::initFilePath( void ) { notify(DEBUG_INFO) << "osgDB::Init(NULL)"< +#include + #include "FTFace.h" #include "FTGLBitmapFont.h" #include "FTGLPixmapFont.h" @@ -63,16 +65,21 @@ bool Font:: open(const std::string& font) { clear(); + + char* filename = osgDB::findFile(font.c_str()); + if (filename) + { - _font=createFontObj(); - if( _font!=NULL && _font->Open(font.c_str()) ) - { - _init=true; - _fontName=font; - return true; - } - else - return false; + _font=createFontObj(); + if( _font!=NULL && _font->Open(filename) ) + { + _init=true; + _fontName=font; + return true; + } + else + return false; + } } bool Font::