diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-25 22:35:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-25 22:35:30 +0300 |
commit | dcfc97836830d4100a0a520b77d68d908314ee60 (patch) | |
tree | c35eccea345638b1abe2a3875065a36065bf8691 /src/gui/gui.cpp | |
parent | f939a7bbbc19bb69726377eed7b36542d6a5cf3f (diff) | |
download | plus-dcfc97836830d4100a0a520b77d68d908314ee60.tar.gz plus-dcfc97836830d4100a0a520b77d68d908314ee60.tar.bz2 plus-dcfc97836830d4100a0a520b77d68d908314ee60.tar.xz plus-dcfc97836830d4100a0a520b77d68d908314ee60.zip |
Add npc font size with 13 pixels size.
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, |