X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCockpit%2Fpanel.cxx;h=be2f12570e8fb3d336e9e79d0c68ccee5b2a0155;hb=97a251544371dbe9073a2c77df8b936176b916dc;hp=e2caa87f0cc1d0bd963f7d34422e4e2e3dfb389f;hpb=8b10bb12f59618a772ddcda93541ac45b3fd7246;p=flightgear.git diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index e2caa87f0..be2f12570 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -1109,7 +1109,12 @@ FGTextLayer::draw (osg::State& state) transform(); FGFontCache *fc = globals->get_fontcache(); - text_renderer.setFont(fc->getTexFont(_font_name.c_str())); + fntFont* font = fc->getTexFont(_font_name.c_str()); + if (!font) { + return; // don't crash on missing fonts + } + + text_renderer.setFont(font); text_renderer.setPointSize(_pointSize); text_renderer.begin(); @@ -1170,6 +1175,11 @@ void FGTextLayer::setFontName(const string &name) { _font_name = name + ".txf"; + FGFontCache *fc = globals->get_fontcache(); + fntFont* font = fc->getTexFont(_font_name.c_str()); + if (!font) { + SG_LOG(SG_GENERAL, SG_WARN, "unable to find font:" << name); + } }