summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-14 23:57:06 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-15 00:10:47 +0200
commit412a8fd2cff7f24729ab36bc6a59fd533b6d26c0 (patch)
tree07e93d8945f712a12dbbdd2a71fa916b9ae393e1 /src/gui/gui.cpp
parentbeac98b7d093bca0fa921e5e30c2b766fb0298e9 (diff)
downloadmana-client-412a8fd2cff7f24729ab36bc6a59fd533b6d26c0.tar.gz
mana-client-412a8fd2cff7f24729ab36bc6a59fd533b6d26c0.tar.bz2
mana-client-412a8fd2cff7f24729ab36bc6a59fd533b6d26c0.tar.xz
mana-client-412a8fd2cff7f24729ab36bc6a59fd533b6d26c0.zip
Also hardcode the bold font, we ship it after all
Plus some tweaks and cleanups.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 2c75a9f1..8a4e4aec 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -105,32 +105,31 @@ Gui::Gui(Graphics *graphics):
ResourceManager *resman = ResourceManager::getInstance();
// Set global font
- std::string path = resman->getPath(
- branding.getValue("font", "fonts/dejavusans.ttf"));
+ const int fontSize = (int) config.getValue("fontSize", 11);
+ std::string fontFile = branding.getValue("font", "fonts/dejavusans.ttf");
+ std::string path = resman->getPath(fontFile);
try
{
- const int fontSize = (int)config.getValue("fontSize", 11);
mGuiFont = new TrueTypeFont(path, fontSize);
- mInfoParticleFont = new TrueTypeFont(path, fontSize, 1);
+ mInfoParticleFont = new TrueTypeFont(path, fontSize, TTF_STYLE_BOLD);
}
catch (gcn::Exception e)
{
- logger->error(std::string("Unable to load dejavusans.ttf: ")
- + e.getMessage());
+ logger->error(std::string("Unable to load '") + fontFile +
+ std::string("': ") + e.getMessage());
}
// Set bold font
- path = resman->getPath(
- branding.getValue("boldFont", "fonts/dejavusans.ttf"));
+ fontFile = branding.getValue("boldFont", "fonts/dejavusans-bold.ttf");
+ path = resman->getPath(fontFile);
try
{
- const int fontSize = (int)config.getValue("fontSize", 11);
boldFont = new TrueTypeFont(path, fontSize);
}
catch (gcn::Exception e)
{
- logger->error(std::string("Unable to load dejavusans-bold.ttf: ")
- + e.getMessage());
+ logger->error(std::string("Unable to load '") + fontFile +
+ std::string("': ") + e.getMessage());
}
gcn::Widget::setGlobalFont(mGuiFont);
@@ -243,8 +242,3 @@ void Gui::handleMouseMoved(const gcn::MouseInput &mouseInput)
gcn::Gui::handleMouseMoved(mouseInput);
mMouseInactivityTimer = 0;
}
-
-const int Gui::getFontHeight() const
-{
- return mGuiFont->getHeight();
-}