diff options
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index afced01b2..8dcaaafa1 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -201,6 +201,22 @@ Gui::Gui(Graphics *graphics): std::string("': ") + e.getMessage()); } + // Set npc font + fontFile = config.getValue("npcFont", ""); + const int npcFontSize = config.getIntValue("npcfontSize"); + if (fontFile.empty()) + fontFile = branding.getStringValue("npcFont"); + + try + { + mNpcFont = new SDLFont(fontFile, npcFontSize); + } + catch (const gcn::Exception &e) + { + logger->error(std::string("Unable to load '") + fontFile + + std::string("': ") + e.getMessage()); + } + gcn::Widget::setGlobalFont(mGuiFont); // Initialize mouse cursor and listen for changes to the option @@ -463,11 +479,13 @@ void Gui::updateFonts() boldFont->loadFont(fontFile, fontSize); - fontFile = config.getValue("secureFont", ""); + const int npcFontSize = config.getIntValue("npcfontSize"); + + fontFile = config.getValue("npcFont", ""); if (fontFile.empty()) - fontFile = branding.getStringValue("secureFont"); + fontFile = branding.getStringValue("npcFont"); - mSecureFont->loadFont(fontFile, fontSize); + mNpcFont->loadFont(fontFile, npcFontSize); } void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button, |