# include <config.h>
#endif
+#include "panel.hxx"
+
#include <stdio.h> // sprintf
#include <string.h>
#include <iostream>
#include <Main/viewmgr.hxx>
#include <Time/light.hxx>
#include <GUI/new_gui.hxx> // FGFontCache
+#include <Main/viewer.hxx>
+#include <Instrumentation/dclgps.hxx>
#include "hud.hxx"
-#include "panel.hxx"
+
#define WIN_X 0
#define WIN_Y 0
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();
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);
+ }
}