From 6d3f9ce3072cf789165a5f28b073129937f47815 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sun, 26 Apr 2020 22:20:57 +0200 Subject: [PATCH] puts an end of error spam when OSG is copmiled without Freetype support --- components/resource/stats.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/resource/stats.cpp b/components/resource/stats.cpp index 51497cd27..1d78d7a4c 100644 --- a/components/resource/stats.cpp +++ b/components/resource/stats.cpp @@ -8,6 +8,8 @@ #include +#include + #include #include @@ -32,12 +34,14 @@ 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"); setKeyEventTogglesOnScreenStats(osgGA::GUIEventAdapter::KEY_F3); }