From dcfc97836830d4100a0a520b77d68d908314ee60 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Jun 2012 22:35:30 +0300 Subject: Add npc font size with 13 pixels size. --- src/gui/gui.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/gui/gui.cpp') 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, -- cgit v1.2.3-60-g2f50