From 4371c8c1ffcf24e8d5a7cf2ec126be239cab3d76 Mon Sep 17 00:00:00 2001 From: David Athay Date: Fri, 18 Apr 2008 15:23:49 +0000 Subject: Fixed numerous crashes with chat and guild windows using new tabbed area. --- src/gui/gui.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 2ef7aba3..db0d1905 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -107,24 +107,20 @@ Gui::Gui(Graphics *graphics): Window::setWindowContainer(guiTop); setTop(guiTop); + ResourceManager *resman = ResourceManager::getInstance(); + // Set global font - try { - mGuiFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 11); - } - catch (gcn::Exception e) + std::string path = resman->getPath("fonts/dejavusans.ttf"); + if (path != "") { - logger->error(std::string("Unable to load dejavusans.ttf: ") + e.getMessage()); + mGuiFont = new TrueTypeFont(path.c_str(), 11); } // Set speech font - try - { - // FIXME: use another font? - speechFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 11); - } - catch (gcn::Exception e) + path = resman->getPath("fonts/dejavusans.ttf"); + if (path != "") { - logger->error(std::string("Unable to load dejavusans.ttf: ") + e.getMessage()); + speechFont = new TrueTypeFont(path.c_str(), 11); } gcn::Widget::setGlobalFont(mGuiFont); -- cgit v1.2.3-70-g09d2