diff --git a/components/resource/stats.cpp b/components/resource/stats.cpp index 51497cd27..bc63ddf58 100644 --- a/components/resource/stats.cpp +++ b/components/resource/stats.cpp @@ -8,6 +8,8 @@ #include +#include + #include #include @@ -32,12 +34,16 @@ StatsHandler::StatsHandler(): _resourceStatsChildNum = 0; - _font = osgMyGUI::DataManager::getInstance().getDataPath("DejaVuLGCSansMono.ttf"); + if (osgDB::Registry::instance()->getReaderWriterForExtension("ttf")) + _font = osgMyGUI::DataManager::getInstance().getDataPath("DejaVuLGCSansMono.ttf"); } Profiler::Profiler() { - _font = osgMyGUI::DataManager::getInstance().getDataPath("DejaVuLGCSansMono.ttf"); + if (osgDB::Registry::instance()->getReaderWriterForExtension("ttf")) + _font = osgMyGUI::DataManager::getInstance().getDataPath("DejaVuLGCSansMono.ttf"); + else + _font = ""; setKeyEventTogglesOnScreenStats(osgGA::GUIEventAdapter::KEY_F3); }